home *** CD-ROM | disk | FTP | other *** search
/ Internet Warrior 1993 July / Internet Warrior No. 1 July 1993 - Austin Code Works.ISO / docs / tcpip / admin.doc next >
Encoding:
Text File  |  1993-02-21  |  138.7 KB  |  2,824 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                              Introduction
  12.                                   to
  13.                             Administration
  14.                                 of an
  15.                             Internet-based
  16.                             Local Network
  17.  
  18.  
  19.  
  20.                       C                       R
  21.  
  22.                               C       S
  23.                   Computer Science Facilities Group
  24.                               C       I
  25.  
  26.                       L                       S
  27.  
  28.  
  29.                                RUTGERS
  30.                   The State University of New Jersey
  31.             Center for Computers and Information Services
  32.                Laboratory for Computer Science Research
  33.  
  34.  
  35.                              24 July 1988
  36.  
  37. This  is an introduction for people who intend to set up or administer
  38. a network based on the Internet networking protocols (TCP/IP).
  39.  
  40. Copyright (C) 1988, Charles L. Hedrick.   Anyone  may  reproduce  this
  41. document,  in  whole  or  in  part,  provided  that:   (1) any copy or
  42. republication of the entire document must show Rutgers  University  as
  43. the  source,  and  must  include this notice; and (2) any other use of
  44. this material must reference this manual and Rutgers  University,  and
  45. the fact that the material is copyright by Charles Hedrick and is used
  46. by permission.
  47.  
  48.  
  49.  
  50. Unix is a trademark of AT&T Technologies, Inc.
  51.  
  52.  
  53.  
  54.                           Table of Contents
  55.  
  56.  
  57.    1. The problem                                                    1
  58.    2. Routing and Addressing                                         2
  59.    3. Choosing an addressing structure                               3
  60.        3.1 Should you subdivide your address space?                  5
  61.        3.2 Subnets vs. multiple network numbers                      5
  62.        3.3 How to allocate subnet or network numbers                 6
  63.            3.3.1 Dealing with multiple "virtual" subnets  on  one    7
  64.                  network
  65.        3.4 Choosing an address class                                 8
  66.    4. Setting up routing for an individual computer                  9
  67.        4.1 How datagrams are routed                                 11
  68.        4.2 Fixed routes                                             13
  69.        4.3 Routing redirects                                        14
  70.        4.4 Other ways for hosts to find routes                      16
  71.            4.4.1 Spying on Routing                                  16
  72.            4.4.2 Proxy ARP                                          17
  73.            4.4.3 Moving to New Routes After Failures                22
  74.    5. Bridges and Gateways                                          24
  75.        5.1 Alternative Designs                                      25
  76.            5.1.1 A mesh of point to point lines                     26
  77.            5.1.2 Circuit switching technology                       27
  78.            5.1.3 Single-level networks                              27
  79.            5.1.4 Mixed designs                                      28
  80.        5.2 An introduction to alternative switching technologies    29
  81.            5.2.1 Repeaters                                          29
  82.            5.2.2 Bridges and gateways                               30
  83.            5.2.3 More about bridges                                 32
  84.            5.2.4 More about gateways                                34
  85.        5.3 Comparing the switching technologies                     34
  86.            5.3.1 Isolation                                          35
  87.            5.3.2 Performance                                        36
  88.            5.3.3 Routing                                            37
  89.            5.3.4 Network management                                 39
  90.            5.3.5 A final evaluation                                 41
  91.        5.4 Configuring routing for gateways                         44
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.                                   i
  110.  
  111.  
  112.  
  113. This  document is intended to help people who planning to set up a new
  114. network based on the Internet protocols, or to administer an  existing
  115. one.    It  assumes  a  basic  familiarity  with the TCP/IP protocols,
  116. particularly the structure of Internet addresses.  A companion  paper,
  117. "Introduction  to  the  Internet  Protocols", may provide a convenient
  118. introduction.  This document does not  attempt  to  replace  technical
  119. documentation  for  your  specific  TCP/IP implementation.  Rather, it
  120. attempts to give overall  background  that  is  not  specific  to  any
  121. particular implementation.  It is directed specifically at networks of
  122. "medium" complexity.  That  is,  it  is  probably  appropriate  for  a
  123. network  involving  several dozen buildings.  Those planning to manage
  124. larger networks will need more preparation than you can get by reading
  125. this document.
  126.  
  127. In  a  number  of  cases,  commands  and output from Berkeley Unix are
  128. shown.  Most computer  systems  have  commands  that  are  similar  in
  129. function to these.  It seemed more useful to give some actual examples
  130. that to limit myself to general talk, even if the  actual  output  you
  131. see is slightly different.
  132.  
  133.  
  134.  
  135. 1. The problem
  136.  
  137.  
  138. This document will emphasize primarily "logical" network architecture.
  139. There are many documents and articles in the trade press that  discuss
  140. actual  network  media,  such  as  Ethernet, Token Ring, etc.  What is
  141. generally not made clear in these  articles  is  that  the  choice  of
  142. network  media  is  generally  not  all  that critical for the overall
  143. design of a network.  What can be done by  the  network  is  generally
  144. determined more by the network protocols supported, and the quality of
  145. the implementations.  In practice, media are normally chosen based  on
  146. purely  pragmatic  grounds: what media are supported by the particular
  147. types of computer that you have to connect.  Generally this means that
  148. Ethernet is used for medium-scale systems, Ethernet or a network based
  149. on twisted-pair wiring for micro networks, and specialized  high-speed
  150. networks  (typically  token  ring)  for campus-wide backbones, and for
  151. local  networks  involving  super-computer  and   other   very   high-
  152. performance applications.
  153.  
  154. Thus  this  document  assumes  that  you  have  chosen  and  installed
  155. individual networks such as Ethernet or token ring,  and  your  vendor
  156. has  helped  you connect your computers to these network.  You are now
  157. faced with the interrelated problems of
  158.  
  159.    - configuring the software on your computers
  160.  
  161.    - finding a way to connect individual Ethernets, token rings, etc.,
  162.      to form a single coherent network
  163.  
  164.    - connecting your networks to the outside world
  165.  
  166. My  primary  thesis in this document is that these decisions require a
  167. bit  of  advance  thought.    In   fact,   most   networks   need   an
  168.                                   1
  169.  
  170.  
  171.  
  172. "architecture".   This consists of a way of assigning addresses, a way
  173. of doing routing, and various choices about how  hosts  interact  with
  174. the  network.  These decisions need to be made for the entire network,
  175. preferably when it is first being installed.
  176.  
  177.  
  178.  
  179. 2. Routing and Addressing
  180.  
  181.  
  182. Many of the decisions that you need  to  make  in  setting  up  TCP/IP
  183. depend upon routing, so it will be best to give a bit of background on
  184. that topic now.  I will return to routing  in  a  later  section  when
  185. discussing  gateways  and  bridges.    In  general,  IP datagrams pass
  186. through many networks while they are  going  between  the  source  and
  187. destination.    Here's  a  typical  example.    (Addresses used in the
  188. examples are taken from Rutgers University.)
  189.  
  190.               network 1               network 2     network 3
  191.                128.6.4                 128.6.21      128.121
  192.         ============================  ==========  ================
  193.           |              |        |    |      |    |         |
  194.        ___|______   _____|____  __|____|__  __|____|____  ___|________
  195.        128.6.4.2    128.6.4.3   128.6.4.1   128.6.21.1    128.121.50.2
  196.                                 128.6.21.2  128.121.50.1
  197.        __________   __________  __________  ____________  ____________
  198.        computer A   computer B   gateway R    gateway S    computer C
  199.  
  200.  
  201. This diagram shows three normal computer systems,  two  gateways,  and
  202. three  networks.  The networks might be Ethernets, token rings, or any
  203. other sort.  Network 2 could even be a  single  point  to  point  line
  204. connecting gateways R and S.
  205.  
  206. Note  that computer A can send datagrams to computer B directly, using
  207. network 1.  However it can't reach computer  C  directly,  since  they
  208. aren't  on  the  same  network.    There  are  several ways to connect
  209. separate networks.  This diagram assumes that gateways are used. (In a
  210. later section, we'll look at an alternative.)  In this case, datagrams
  211. going between A and C must be sent through gateway R, network  2,  and
  212. gateway   S.   Every  computer  that  uses  TCP/IP  needs  appropriate
  213. information and algorithms to allow it to know when datagrams must  be
  214. sent through a gateway, and to choose an appropriate gateway.
  215.  
  216. Routing  is  very  closely tied to the choice of addresses.  Note that
  217. the address of each computer begins with the  number  of  the  network
  218. that  it's  attached  to.    Thus  128.6.4.2 and 128.6.4.3 are both on
  219. network 128.6.4.  Next, notice that gateways, whose job is to  connect
  220. networks,  have  an  address  on each of those networks.  For example,
  221. gateway R connects networks 128.6.4 and 128.6.21.  Its  connection  to
  222. network  128.6.4 has the address 128.6.4.1.  Its connection to network
  223. 128.6.21 has the address 128.6.21.2.
  224.  
  225. Because of this association between addresses  and  networks,  routing
  226. decisions  can  be  based  strictly  on  the  network  number  of  the
  227.                                   2
  228.  
  229.  
  230.  
  231. destination.  Here's what the routing information for computer A might
  232. look like:
  233.  
  234.        network    gateway     metric
  235.  
  236.        128.6.4    none        0
  237.        128.6.21   128.6.4.1   1
  238.        128.121    128.6.4.1   2
  239.  
  240. From  this  table, computer A can tell that datagrams for computers on
  241. network 128.6.4 can be sent directly, and datagrams for  computers  on
  242. networks  128.6.21  and  128.121  need  to  be  sent  to gateway R for
  243. forwarding.  The "metric" is used by  some  routing  algorithms  as  a
  244. measure  of how far away the destination is.  In this case, the metric
  245. simply indicates how many gateways the datagram  has  to  go  through.
  246. (This is often referred to as a "hop count".)
  247.  
  248. When  computer  A  is  ready  to  send  a  datagram,  it  examines the
  249. destination address.  The network number is taken from  the  beginning
  250. of  the  address  and looked up in the routing table.  The table entry
  251. indicates  whether  the  packet  should  be  sent  directly   to   the
  252. destination or to a gateway.
  253.  
  254. Note  that  a  gateway  is  simply a computer that is connected to two
  255. different networks, and is prepared to forward packets  between  them.
  256. In  many  cases  it is most efficient to use special-purpose equipment
  257. designed for use as a gateway.  However it is  perfectly  possible  to
  258. use ordinary computers as gateways, as long as they have more than one
  259. network  interface,  and  their  software  is  prepared   to   forward
  260. datagrams.       Most   major   TCP/IP   implementations   (even   for
  261. microcomputers) are designed  to  let  you  use  your  computer  as  a
  262. gateway.  However some of this software has limitations that can cause
  263. trouble for your network.
  264.  
  265.  
  266.  
  267. 3. Choosing an addressing structure
  268.  
  269.  
  270. The first comment to make about addresses is  a  warning:  Before  you
  271. start  using  a  TCP/IP  network,  you  must  get one or more official
  272. network numbers.  TCP/IP addresses look like this:  128.6.4.3.    This
  273. address is used by one computer at Rutgers University.  The first part
  274. of it, 128.6, is a network number, allocated to Rutgers by  a  central
  275. authority.    Before you start allocating addresses to your computers,
  276. you must get an official network number.  Unfortunately,  some  people
  277. set  up  networks  using  either a randomly-chosen number, or a number
  278. taken from examples in vendor documentation.  While this may  work  in
  279. the  short  run,  it is a very bad idea for the long run.  Eventually,
  280. you will want to connect your network  to  some  other  organization's
  281. network.    Even  if  your  organization  is  highly  secret  and very
  282. concerned about security, somewhere  in  your  organization  there  is
  283. going  to  be  a  research  computer that ends up being connected to a
  284. nearby university.  That university will probably be  connected  to  a
  285. large-scale  national  network.    As  soon  as  one of your datagrams
  286.                                   3
  287.  
  288.  
  289.  
  290. escapes your local network, the organization you  are  talking  to  is
  291. going  to  become  very confused, because the addresses that appear in
  292. your datagrams are probably officially allocated to someone else.
  293.  
  294. The solution to this is simple: get your own network number  from  the
  295. beginning.    It  costs nothing.  If you delay it, then sometime years
  296. from now you are going to be faced with  the  job  of  changing  every
  297. address on a large network.  Network numbers are currently assigned by
  298. the DDN Network Information Center, SRI International, 333  Ravenswood
  299. Avenue,  Menlo  Park, California 94025 (telephone: 800-235-3155).  You
  300. can get a network number no matter what your  network  is  being  used
  301. for.    You  do  not need authorization to connect to the Defense Data
  302. Network in order to get a number.  The main piece of information  that
  303. will  be  needed  when  you apply for a network number is that address
  304. class that you want.  See below for a discussion of this.
  305.  
  306. In many ways, the most important decision you have to make in  setting
  307. up  a  network  is  how  you  will  assign  Internet addresses to your
  308. computers.  This choice should be made with a view of how your network
  309. is  likely  to grow.  Otherwise, you will find that you have to change
  310. addresses.  When you have several hundred computers,  address  changes
  311. can be nearly impossible.
  312.  
  313. Addresses  are  critical  because Internet datagrams are routed on the
  314. basis of their address.  For example, addresses at Rutgers  University
  315. have  a  2-level structure.  A typical address is 128.6.4.3.  128.6 is
  316. assigned to Rutgers University by a central authority.  As far as  the
  317. outside  world  is  concerned,  128.6  is  a  single  network.   Other
  318. universities send any packet whose address begins with  128.6  to  the
  319. nearest  Rutgers  gateway.    However within Rutgers, we divide up our
  320. address space into "subnets".  We use the next 8 bits  of  address  to
  321. indicate  which  subnet  a  computer belongs to.  128.6.4.3 belongs to
  322. subnet 128.6.4.  Generally subnets correspond  to  physical  networks,
  323. e.g.  separate  Ethernets,  although as we will see later there can be
  324. exceptions.  Systems inside Rutgers,  unlike  those  outside,  contain
  325. information  about the Rutgers subnet structure.  So once a packet for
  326. 128.6.4.3 arrives at Rutgers, the Rutgers network will route it to the
  327. departmental Ethernet, token ring, or whatever, that has been assigned
  328. subnet number 128.6.4.
  329.  
  330. When you start a network, there are several addressing decisions  that
  331. face you:
  332.  
  333.    - Do you subdivide your address space?
  334.  
  335.    - If so, do you use subnets or class C addresses?
  336.  
  337.    - You do you allocate subnets or class C networks?
  338.  
  339.    - How big an address space do you need?
  340.  
  341.  
  342.  
  343.  
  344.  
  345.                                   4
  346.  
  347.  
  348.  
  349. 3.1 Should you subdivide your address space?
  350.  
  351.  
  352. It  is  not  necessary  to  use  subnets  at  all.   There are network
  353. technologies that allow an entire campus or company to act as a single
  354. large  logical Ethernet, so that no internal routing is necessary.  If
  355. you use this technology, then  you  do  not  need  to  subdivide  your
  356. address  space.    In that case, the only decision you have to make is
  357. what class address to apply for.  However we recommend using either  a
  358. subnet approach or some other method of subdividing your address space
  359. in all cases:
  360.  
  361.    - In section 5.2 we will argue that internal gateways are desirable
  362.      for networks of any degree of complexity.
  363.  
  364.    - Even if you do not need gateways now, you may find later that you
  365.      need to  use  them.  Thus  it  probably  makes  sense  to  assign
  366.      addresses  as  if  each  Ethernet or token ring was going to be a
  367.      separate subnet.  This will allow for conversion to real  subnets
  368.      later if it proves necessary.
  369.  
  370.    - For  network  maintenance  purposes,  it  is  convenient  to have
  371.      addresses whose structure corresponds to  the  structure  of  the
  372.      network.    That  is,  when  you  see  a stray packet from system
  373.      128.6.4.3, it is nice to know that all addresses  beginning  with
  374.      128.6.4 are in a particular building.
  375.  
  376.  
  377.  
  378. 3.2 Subnets vs. multiple network numbers
  379.  
  380.  
  381. Suppose  that  you have been convinced that it's a good idea to impose
  382. some structure on your addresses.  The  next  question  is  what  that
  383. structure should be.  There are two basic approaches.  One is subnets.
  384. The other is multiple network numbers.
  385.  
  386. The Internet standards specify what constitutes a network number.  For
  387. numbers  beginning with 128 through 191 (the most common numbers these
  388. days), the first  two  octets  form  the  network  number.    E.g.  in
  389. 140.3.50.1, 140.3 is the network number.  Network numbers are assigned
  390. to a particular organization.  What you do with the next two octets is
  391. up  to  you.    You  could  choose  to make the next octet be a subnet
  392. number, or you could use some other scheme entirely.  Gateways  within
  393. your  organization  will  be set up to know the subnetting scheme that
  394. you are using.  However outside your organization, no  one  will  know
  395. that 140.3.50 is one subnet and 140.3.51 is another.  They will simply
  396. know that 140.3 is your organization.  Unfortunately, this ability  to
  397. add additional structure to the address via subnets was not present in
  398. the original TCP/IP specifications.  Thus some software  is  incapable
  399. of being told about subnets.
  400.  
  401. If  enough of the software that you are using has this problem, it may
  402. be impractical for you to use subnets.  Some organizations have used a
  403. different  approach.   It is possible for an organization to apply for
  404.                                   5
  405.  
  406.  
  407.  
  408. several network numbers.  Instead of dividing a single network number,
  409. say  140.3,  into  several subnets, e.g. 140.3.1 through 140.3.10, you
  410. could apply for 10 different network  numbers.    Thus  you  might  be
  411. assigned  the  range  140.3  through 140.12.  All TCP/IP software will
  412. know that these are different network numbers.
  413.  
  414. While using separate network numbers will work just fine  within  your
  415. organization,  it  has two very serious disadvantages.  The first, and
  416. less serious, is that it wastes address space.  There are  only  about
  417. 16,000  possible  class  B addresses.  We cannot afford to waste 10 of
  418. them on your organization, unless it is very large.  This objection is
  419. less  serious because you would normally ask for class C addresses for
  420. this  purpose,  and  there  are  about  2  million  possible  class  C
  421. addresses.
  422.  
  423. The  more  serious  problem  with using several network numbers rather
  424. than subnets is that it overloads the routing tables in  the  rest  of
  425. the Internet.  As mentioned above, when you divide your network number
  426. into subnets, this division is known within your organization, but not
  427. outside  it.    Thus  systems  outside your organization need only one
  428. entry in their tables in order to be able to reach you.    E.g.  other
  429. universities  have entries in their routing tables for 128.6, which is
  430. the Rutgers network number.  If you use a  range  of  network  numbers
  431. instead  of  subnets,  that  division  will  be  visible to the entire
  432. Internet.  If we used 128.6  through  128.16  instead  of  subdividing
  433. 128.6, other universities would need entries for each of those network
  434. numbers in their routing tables.   As  of  this  writing  the  routing
  435. tables  in many of the national networks are exceeding the size of the
  436. current  routing  technology.    It  would  be  considered   extremely
  437. unfriendly  for  any organization to use more than one network number.
  438. This may not be a problem if your network is going  to  be  completely
  439. self-contained,  or if only one small piece of it will be connected to
  440. the  outside  world.    Nevertheless,  most  TCP/IP  experts  strongly
  441. recommend  that  you  use  subnets rather than multiple networks.  The
  442. only reason for considering multiple networks is to deal with software
  443. that  cannot  handle subnets.  This was a problem a few years ago, but
  444. is currently less serious.   As  long  as  your  gateways  can  handle
  445. subnets,  you  can deal with a few individual computers that cannot by
  446. using "proxy ARP" (see below).
  447.  
  448.  
  449.  
  450. 3.3 How to allocate subnet or network numbers
  451.  
  452.  
  453. Now that you have decided to use subnets or multiple network  numbers,
  454. you  have  to  decide  how  to allocate them.  Normally this is fairly
  455. easy.  Each physical network, e.g. Ethernet or token ring, is assigned
  456. a  separate  subnet  or  network  number.    However  you do have some
  457. options.
  458.  
  459. In some cases it may make sense to assign several subnet numbers to  a
  460. single  physical  network.   At Rutgers we have a single Ethernet that
  461. spans three buildings, using repeaters.  It is very clear to  us  that
  462. as  computers  are  added  to this Ethernet, it is going to have to be
  463.                                   6
  464.  
  465.  
  466.  
  467. split into several separate Ethernets.  In order to  avoid  having  to
  468. change  addresses when this is done, we have allocated three different
  469. subnet numbers to this Ethernet, one per building.    (This  would  be
  470. handy  even  if  we didn't plan to split the Ethernet, just to help us
  471. keep track of where computers are.)  However before doing  this,  make
  472. very  sure  that  the  software  on all of your computers can handle a
  473. network that has three different network numbers on it.
  474.  
  475. You also have to choose a "subnet mask".  This is used by the software
  476. on  your  systems to separate the subnet from the rest of the address.
  477. So far we have always assumed  that  the  first  two  octets  are  the
  478. network  number, and the next octet is the subnet number.  For class B
  479. addresses, the standards specify that the first  two  octets  are  the
  480. network  number.    However we are free to choose the boundary between
  481. the subnet number and the rest of the address.  It's  very  common  to
  482. have  a  one-octet  subnet  number,  but  that's not the only possible
  483. choice.  Let's look again at a class B address, e.g. 128.6.4.3.  It is
  484. easy to see that if the third octet is used for a subnet number, there
  485. are 256 possible subnets and within each subnet there are 256 possible
  486. addresses.    (Actually,  the  numbers  are more like 254, since it is
  487. generally a bad idea to use 0 or 255 for subnet numbers or addresses.)
  488. Suppose you know that you will never have more than 128 computers on a
  489. given subnet, but you are afraid you might need more than 256 subnets.
  490. (For  example,  you might have a campus with lots of small buildings.)
  491. In that case, you could define 10 bits for the subnet number,  leaving
  492. 6  bits for addresses within each subnet.  This choice is expressed by
  493. a bit mask, using ones for the bits used by  the  network  and  subnet
  494. number,  and  0's  for  the  bits  used for individual addresses.  Our
  495. normal subnet choice is given as 255.255.255.0.  If we  chose  10  bit
  496. subnet  numbers  and  6  bit  addresses,  the  subnet  mask  would  be
  497. 255.255.255.192.
  498.  
  499. Generally it is possible to specify the subnet mask for each  computer
  500. as part of configuring its TCP/IP software.  The TCP/IP protocols also
  501. allow for computers to send a query asking what the  subnet  mask  is.
  502. If  your network supports broadcast queries, and there is at least one
  503. computer or gateway on the network that knows the subnet mask, it  may
  504. be  unnecessary  to  set  it on the other computers.  (This capability
  505. brings with it a whole new set of possible problems.   One  well-known
  506. TCP/IP  implementation  would  answer  with the wrong subnet mask when
  507. queried, thus leading causing every other computer on the  network  to
  508. be misconfigured.)
  509.  
  510.  
  511.  
  512. 3.3.1 Dealing with multiple "virtual" subnets on one network
  513.  
  514.  
  515. Most  software  is written under the assumption that every computer on
  516. the local network has the same subnet number.  When traffic  is  being
  517. sent  to  a  machine with a different subnet number, the software will
  518. generally expect to find  a  gateway  to  handle  forwarding  to  that
  519. subnet.  Let's look at the implications.  Suppose subnets 128.6.19 and
  520. 128.6.20 are on the same Ethernet.  Consider the way things look  from
  521. the point of view of a computer with address 128.6.19.3.  It will have
  522.                                   7
  523.  
  524.  
  525.  
  526. no problem sending to other machines with addresses 128.6.19.x.   They
  527. are on the same subnet, and so our computer will know to send directly
  528. to them on the local Ethernet.  However suppose it is asked to send  a
  529. packet to 128.6.20.2.  Since this is a different subnet, most software
  530. will expect to find a gateway that handles forwarding between the  two
  531. subnets.  Of course there isn't a gateway between subnets 128.6.19 and
  532. 128.6.20, since they are on the  same  Ethernet.    Thus  it  must  be
  533. possible  to  tell your software that 128.6.20 is actually on the same
  534. Ethernet.
  535.  
  536. For the most common TCP/IP implementations, it  is  possible  to  deal
  537. with  more  than  one subnet on a network.  For example, Berkeley Unix
  538. allows you to define gateways using a command "route  add".    Suppose
  539. that  you  get  from subnet 128.6.19 to subnet 128.6.4 using a gateway
  540. whose address is 128.6.19.1.  You would use the command
  541.  
  542.   route add 128.6.4.0 128.6.19.1 1
  543.  
  544. This says that to reach subnet 128.6.4, traffic should be sent via the
  545. gateway  at  128.6.19.1, and that the route only has to go through one
  546. gateway.  The "1" is referred to as the "routing metric".  If you  use
  547. a  metric  of  0, you are saying that the destination subnet is on the
  548. same network, and no gateway is needed.  In  our  example,  on  system
  549. 128.6.19.3, you would use
  550.  
  551.   route add 128.6.20.0 128.6.19.1 0
  552.  
  553. The  actual  address  used  in place of 128.6.19.1 is irrelevant.  The
  554. metric of 0 says that no gateway is actually going to be used, so  the
  555. gateway  address  is  not used.  However it must be a legal address on
  556. the local network.
  557.  
  558. Note that the commands in this section are simply examples. You should
  559. look  in  the  documentation for your particular implementation to see
  560. how to configure your routing.
  561.  
  562.  
  563.  
  564. 3.4 Choosing an address class
  565.  
  566.  
  567. When you apply for an official network number, you will be asked  what
  568. class  of network number you need.  The possible answers are A, B, and
  569. C. This affects how large an address  space  you  will  be  allocated.
  570. Class  A addresses are one octet long, class B addresses are 2 octets,
  571. and class C addresses are 3  octets.    This  represents  a  tradeoff:
  572. there are a lot more class C addresses than class A addresses, but the
  573. class C addresses don't allow as many hosts.  The idea was that  there
  574. would  be  a few very large networks, a moderate number of medium-size
  575. ones, and a lot of mom-and-pop stores that would have small  networks.
  576. Here is a table showing the distinction:
  577.  
  578.    class  range of first octet   network   rest  possible addresses
  579.      A       1 - 126               p      q.r.s    16777214
  580.      B       128 - 191             p.q      r.s    65534
  581.                                   8
  582.  
  583.  
  584.  
  585.      C       192 - 223             p.q.r      s    254
  586.  
  587. For  example  network  10,  a  class  A network, has addresses between
  588. 10.0.0.1 and 10.255.255.254.  So it allows 254**3, or about 16 million
  589. possible  addresses.    (Actually,  network 10 has allocated addresses
  590. where some of the octets are zero, so there are a  few  more  networks
  591. possible.)    Network  192.12.88,  a class C network has hosts between
  592. 192.12.88.1 and 128.12.88.254, i.e. 254 possible hosts.
  593.  
  594. In general, you will be expected to choose the lowest class that  will
  595. provide  you with enough addresses to handle your growth over the next
  596. few years.  In general  organizations  that  have  computers  in  many
  597. buildings  will  probably  need  and be able to get a class B address,
  598. assuming that they are going to use subnetting.  (If you are going  to
  599. use many separate network numbers, you would ask for a number of class
  600. C addresses.)  Class A addresses are  normally  used  only  for  large
  601. public networks and for a few very large corporate networks.
  602.  
  603.  
  604.  
  605. 4. Setting up routing for an individual computer
  606.  
  607.  
  608. All  TCP/IP  implementations require some configuration for each host.
  609. In some cases this is done in a "system generation".  In other  cases,
  610. various  startup and configuration files must be set up on the system.
  611. Still other systems get configuration information across  the  network
  612. from  a  "server".    While  the  details  differ,  the  same kinds of
  613. information need to  be  supplied  for  most  implementations.    This
  614. includes
  615.  
  616.    - parameters  describing the specific machine, such as its Internet
  617.      address.
  618.  
  619.    - parameters describing the network, such as the  subnet  mask  (if
  620.      any)
  621.  
  622.    - routing software and the tables that drive it
  623.  
  624.    - startup of various programs needed to handle network tasks
  625.  
  626. Before  a  machine  is installed on your network, a coordinator should
  627. assign it a host name and Internet address.  If the machine  has  more
  628. than  one  network  interface,  you  must  assign  a separate Internet
  629. address for each.  (In most cases, the same host  name  can  be  used.
  630. The  name  goes  with  the  machine as a whole, whereas the address is
  631. associated with the connection to a specific network.)    The  address
  632. should begin with the network number for the network to which it is to
  633. be attached.  We recommend that you assign addresses starting from  1.
  634. Should  you  find  that you need more subnets than your current subnet
  635. mask allows, you may later need to expand the subnet mask to use  more
  636. bits.  If all addresses use small numbers, this will be possible.
  637.  
  638. Generally  the  Internet  address  must be specified individually in a
  639. configuration  file  on  each  computer.    However   some   computers
  640.                                   9
  641.  
  642.  
  643.  
  644. (particularly  those  without  permanent  disks on which configuration
  645. information could be  stored)  find  out  their  Internet  address  by
  646. sending  a broadcast request over the network.  In that case, you will
  647. have to make sure that some other system is configured to  answer  the
  648. request.    When  a  system  asks  for  its  Internet  address, enough
  649. information must be put into the request to allow  another  system  to
  650. recognize  it  and  to  send  a  response back.  For Ethernet systems,
  651. generally the  request  will  include  the  Ethernet  address  of  the
  652. requesting  system.    Ethernet addresses are assigned by the computer
  653. manufacturers, and are guaranteed to be unique.  Thus they are a  good
  654. way  of  identifying the computer.  And of course the Ethernet address
  655. is also needed in order to send the response back.  If it is  used  as
  656. the basis for address lookup, the system that is to answer the request
  657. will need a table of Ethernet addresses and the corresponding Internet
  658. address.   The only problem in constructing this table will be finding
  659. the Ethernet address for each  computer.    Generally,  computers  are
  660. designed  so  that  they  print  the  Ethernet  address on the console
  661. shortly after being turned on.  However in some cases you may have  to
  662. type a command that displays information about the Ethernet interface.
  663.  
  664. Generally  the subnet mask should be specified in a configuration file
  665. associated with the computer.    (For  Unix  systems,  the  "ifconfig"
  666. command is used to specify both the Internet address and subnet mask.)
  667. However there are provisions in the IP protocols  for  a  computer  to
  668. broadcast a request asking for the subnet mask.  The subnet mask is an
  669. attribute of the network.  That is, it is the same for  all  computers
  670. on   a  given  subnet.    Thus  there  is  no  separate  subnet  table
  671. corresponding to the Ethernet/Internet address mapping table  used  to
  672. answer  address  queries.    Generally any machine on the network that
  673. believes it knows the subnet mask will  answer  any  query  about  the
  674. subnet mask.  For that reason, an incorrect subnet mask setting on one
  675. machine can cause confusion throughout the network.
  676.  
  677. Normally the configuration files do roughly the following things:
  678.  
  679.    - enable each of the network interfaces (Ethernet interface, serial
  680.      lines,  etc.)    Normally  this  involves  specifying an Internet
  681.      address and subnet mask for each, as well as other  options  that
  682.      will be described in your vendor's documentation.
  683.  
  684.    - establish  network  routing  information, either by commands that
  685.      add fixed routes, or by starting  a  program  that  obtains  them
  686.      dynamically.
  687.  
  688.    - turn  on  the  name server (used for looking up names and finding
  689.      the corresponding Internet address --  see  the  section  on  the
  690.      domain system in the Introduction to TCP/IP).
  691.  
  692.    - set various other information needed by the system software, such
  693.      as the name of the system itself.
  694.  
  695.    - start various "daemons".  These are programs that provide network
  696.      services  to  other  systems on the network, and to users on this
  697.      system.
  698.  
  699.                                   10
  700.  
  701.  
  702.  
  703. It is not practical to document these  steps  in  detail,  since  they
  704. differ for each vendor.  This section will concentrate on a few issues
  705. where your choice will depend upon overall decisions  about  how  your
  706. network  is  to  operate.   These overall network policy decisions are
  707. often not as well documented by the vendors as the details of  how  to
  708. start  specific  programs.    Note that some care will be necessary to
  709. integrate commands that you add for routing, etc.,  into  the  startup
  710. sequence  at  the  right  point.  Some of the most mysterious problems
  711. occur when network routing is not set up before  a  program  needs  to
  712. make  a  network  query,  or when a program attempts to look up a host
  713. name before the name server has finished loading all of the names from
  714. a master name server.
  715.  
  716.  
  717.  
  718. 4.1 How datagrams are routed
  719.  
  720.  
  721. If your system consists of a single Ethernet or similar medium, you do
  722. not need to give routing much attention.   However  for  more  complex
  723. systems,  each  of  your  machines  needs a routing table that lists a
  724. gateway and interface to use for every possible  destination  network.
  725. A  simple  example of this was given at the beginning of this section.
  726. However it is now necessary to describe the way routing works in a bit
  727. more  detail.  On most systems, the routing table looks something like
  728. the following. (This example was taken from a system running  Berkeley
  729. Unix,  using  the  command  "netstat  -n -r".  Some columns containing
  730. statistical information have been omitted.)
  731.  
  732.     Destination          Gateway              Flags       Interface
  733.  
  734.     128.6.5.3            128.6.7.1            UHGD        il0
  735.     128.6.5.21           128.6.7.1            UHGD        il0
  736.     127.0.0.1            127.0.0.1            UH          lo0
  737.     128.6.4              128.6.4.61           U           pe0
  738.     128.6.6              128.6.7.26           U           il0
  739.     128.6.7              128.6.7.26           U           il0
  740.     128.6.2              128.6.7.1            UG          il0
  741.     10                   128.6.4.27           UG          pe0
  742.     128.121              128.6.4.27           UG          pe0
  743.     default              128.6.4.27           UG          pe0
  744.  
  745. The example system is connected to two Ethernets:
  746.  
  747.       controller  network   address     other networks
  748.          il0      128.6.7   128.6.7.26    128.6.6
  749.          pe0      128.6.4   128.6.4.61    none
  750.  
  751. The first column shows the designation  for  the  controller  hardware
  752. that  connects the computer to that Ethernet.  (This system happens to
  753. have controllers from two different vendors.  The first one is made by
  754. Interlan,  the  second  by Pyramid.)  The second column is the network
  755. number for the network.  The third column is this computer's  Internet
  756. address  on  that  network.   The last column shows other subnets that
  757. share the same physical network.
  758.                                   11
  759.  
  760.  
  761.  
  762. Now let's look at the routing table.  For the moment,  let  us  ignore
  763. the  first  3  lines.   The majority of the table consists of a set of
  764. entries describing networks.    For  each  network,  the  other  three
  765. columns  show  where  to send datagrams destined for that network.  If
  766. the "G" flag is present  in  the  third  column,  datagrams  for  that
  767. network  must  be sent through a gateway.  The second column shows the
  768. address of the gateway to be used.  If the "G" flag  is  not  present,
  769. the  computer  is  directly  connected to the network in question.  So
  770. datagrams for that network should be sent using the  controller  shown
  771. in  the  third  column.    The  "U"  flag  in  the third column simply
  772. indicates that the route specified by that line is up,  i.e.  that  no
  773. errors have occured indicating that the path is unusable.
  774.  
  775. The  first  3  lines  show "host routes", indicated by the "H" flag in
  776. column three.    Routing  tables  normally  have  entries  for  entire
  777. networks or subnets.  For example, the entry
  778.  
  779.     128.6.2              128.6.7.1            UG          il0
  780.  
  781. indicates  that  datagrams  for  any computer on network 128.6.2 (i.e.
  782. addresses 128.6.2.1 through 128.6.2.254) should  be  sent  to  gateway
  783. 128.6.7.1  for  forwarding.   However sometimes routes apply only to a
  784. specific computer, rather than to a whole network.  In  that  case,  a
  785. host  route  is used.  The first column then shows a complete address,
  786. and the "H" flag is present in column 3.  E.g. the entry
  787.  
  788.     128.6.5.21           128.6.7.1            UHGD        il0
  789.  
  790. indicates that datagrams for the specific address 128.6.5.21 should be
  791. sent  to  the gateway 128.6.7.1.  As with network routes, the "G" flag
  792. is used for routes that involve a gateway.   The  "D"  flag  indicates
  793. that  the  route  was  added  dynamically,  based  on an ICMP redirect
  794. message from a gateway.  (See below for details.)
  795.  
  796. The following route is special:
  797.  
  798.     127.0.0.1            127.0.0.1            UH          lo0
  799.  
  800. 127.0.0.1 is the address of the "loopback device".  This  is  a  dummy
  801. software  module.  Any datagram sent out through that "device" appears
  802. immediately as input.  It can be  used  for  testing.    The  loopback
  803. address  is  also  handy  for  sending  queries  to  programs that are
  804. designed to respond to network queries, but happen to  be  running  on
  805. the  same  computer.    (Why  bother  to use your network to talk to a
  806. program that is on the same machine you are?)
  807.  
  808. Finally, there are "default" routes, e.g.
  809.  
  810.     default              128.6.4.27           UG          pe0
  811.  
  812. This route is used for datagrams that don't match any other entry.  In
  813. this case, they are sent to a gateway with address 128.6.4.27.
  814.  
  815. In  most  systems,  datagrams are routed by looking up the destination
  816. address in a table such as the one just described.    If  the  address
  817.                                   12
  818.  
  819.  
  820.  
  821. matches  a  specific  host route, then that is used.  Otherwise, if it
  822. matches a network route, that is used.  If no other route  works,  the
  823. default  is  used.   If there is no default, normally the user gets an
  824. error message such as "network is unreachable".
  825.  
  826. The following sections will describe several ways of setting up  these
  827. routing  tables.    Generally, the actual operation of sending packets
  828. doesn't depend upon which method you use to set up the routes.  When a
  829. packet  is to be sent, its destination is looked up in the table.  The
  830. different routing methods are simply more and less sophisticated  ways
  831. of setting up and maintaining the tables.
  832.  
  833.  
  834.  
  835. 4.2 Fixed routes
  836.  
  837.  
  838. The  simplest  way  of  doing  routing  is  to have your configuration
  839. contain commands to set up the routing  table  at  startup,  and  then
  840. leave  it  alone.    This  method  is  practical  for relatively small
  841. networks, particularly if they don't change very often.
  842.  
  843. Most computers automatically set up  some  routing  entries  for  you.
  844. Unix  will  add  an  entry  for the networks to which you are directly
  845. connected.  For example, your startup file might contain the commands
  846.  
  847.       ifconfig ie0 128.6.4.4 netmask 255.255.255.0
  848.       ifconfig ie1 128.6.5.35 netmask 255.255.255.0
  849.  
  850. These  specify  that  there  are  two  network  interfaces,  and  your
  851. addresses on them.  The system will automatically create routing table
  852. entries
  853.  
  854.     128.6.4              128.6.4.4            U           ie0
  855.     128.6.5              128.6.5.35           U           ie1
  856.  
  857. These specify that  datagrams  for  the  local  subnets,  128.6.4  and
  858. 128.6.5, should be sent out the corresponding interface.
  859.  
  860. In  addition  to  these,  your startup files would contain commands to
  861. define routes to whatever other networks you wanted  to  reach.    For
  862. example,
  863.  
  864.       route add 128.6.2.0 128.6.4.1  1
  865.       route add 128.6.6.0 128.6.5.35 0
  866.  
  867. These  commands  specify  that  in  order  to reach network 128.6.2, a
  868. gateway at address 128.6.4.1 should be used, and that network  128.6.6
  869. is  actually  an  additional  network  number for the physical network
  870. connected to interface 128.6.5.35.   Some  other  software  might  use
  871. different  commands  for these cases.  Unix differentiates them by the
  872. "metric", which is the number at the end of the command.   The  metric
  873. indicates  how  many  gateways the datagram will have to go through to
  874. get to the destination.  Routes with metrics of 1 or  greater  specify
  875. the  address of the first gateway on the path.  Routes with metrics of
  876.                                   13
  877.  
  878.  
  879.  
  880. 0 indicate that no gateway  is  involved  --  this  is  an  additional
  881. network number for the local network.
  882.  
  883. Finally, you might define a default route, to be used for destinations
  884. not listed explicitly.  This would normally  show  the  address  of  a
  885. gateway   that   has   enough   information  to  handle  all  possible
  886. destinations.
  887.  
  888. If your network has only one gateway attached to it,  then  of  course
  889. all  you  need is a single entry pointing to it as a default.  In that
  890. case, you need not worry further about  setting  up  routing  on  your
  891. hosts.    (The  gateway  itself needs more attention, as we will see.)
  892. The following sections are intended to provide  help  for  setting  up
  893. networks where there are several different gateways.
  894.  
  895.  
  896.  
  897. 4.3 Routing redirects
  898.  
  899.  
  900. Most  Internet  experts  recommend  leaving  routing  decisions to the
  901. gateways.  That is, it is probably a bad  idea  to  have  large  fixed
  902. routing  tables  on each computer.  The problem is that when something
  903. on the network changes, you have to go around to  many  computers  and
  904. update  the  tables.    If  changes  happen  because a line goes down,
  905. service may not be restored until someone has a chance to  notice  the
  906. problem and change all the routing tables.
  907.  
  908. The  simplest way to keep routes up to date is to depend upon a single
  909. gateway to update your routing tables.  This gateway should be set  as
  910. your  default.  (On Unix, this would mean a command such as "route add
  911. default  128.6.4.27  1",  where  128.6.4.27  is  the  address  of  the
  912. gateway.)   As described above, your system will send all datagrams to
  913. the default when it doesn't have any better route.    At  first,  this
  914. strategy  does  not sound very good if you have more than one gateway.
  915. After all, if all you have is a single default  entry,  how  will  you
  916. ever  use  the other gateways in the cases where they are better?  The
  917. answer is that most gateways are able to send  "redirects"  when  they
  918. get  datagrams  for  which  there  is a better route.  A redirect is a
  919. specific kind of message using  the  ICMP  (Internet  Control  Message
  920. Protocol).    It contains information that generally translates to "In
  921. the future, to get to address XXXXX, please use gateway YYYYY  instead
  922. of  me".    Correct  TCP/IP implementations use these redirects to add
  923. entries to their routing table.  Suppose your routing table starts out
  924. as follows:
  925.  
  926.     Destination          Gateway              Flags       Interface
  927.  
  928.     127.0.0.1            127.0.0.1            UH          lo0
  929.     128.6.4              128.6.4.61           U           pe0
  930.     default              128.6.4.27           UG          pe0
  931.  
  932. This  contains  an entry for the local network, 128.6.4, and a default
  933. pointing to the gateway 128.6.4.27.  Suppose there is also  a  gateway
  934. 128.6.4.30,  which  is the best way to get to network 128.6.7.  How do
  935.                                   14
  936.  
  937.  
  938.  
  939. you find it?  Suppose you have datagrams to send to 128.6.7.23.    The
  940. first  datagram  will go to the default gateway, since that's the only
  941. thing in the routing table.  However the default gateway,  128.6.4.27,
  942. will  notice  that 128.6.4.30 would really be a better route.  (How it
  943. does that is up to the gateway.  However there are some fairly  simple
  944. methods  for a gateway to determine that you would be better off using
  945. a  different  one.)    Thus  128.6.4.27  will  send  back  a  redirect
  946. specifying  that packets for 128.6.7.23 should be sent via 128.6.4.30.
  947. Your TCP/IP software will add a routing entry
  948.  
  949.     128.6.7.23           128.6.4.30           UDHG         pe0
  950.  
  951. Any future datagrams for 128.6.7.23  will  be  sent  directly  to  the
  952. appropriate gateway.
  953.  
  954. This  strategy  would  be a complete solution, if it weren't for three
  955. problems:
  956.  
  957.    - It requires each computer to have  the  address  of  one  gateway
  958.      "hardwired" into its startup files, as the initial default.
  959.  
  960.    - If a gateway goes down, routing table entries using it may not be
  961.      removed.
  962.  
  963.    - If your network uses subnets, and your TCP/IP implementation does
  964.      not handle them, this strategy will not work.
  965.  
  966. How  serious  the  first  problem is depends upon your situation.  For
  967. small networks, there is no problem modifying startup  files  whenever
  968. something  changes.   But some organizations can find it very painful.
  969. If network topology changes, and a gateway  is  removed,  any  systems
  970. that  have  that  gateway  as their default must be adjusted.  This is
  971. particularly serious if the people who maintain the  network  are  not
  972. the  same  as  those  maintaining  the individual systems.  One simple
  973. appoach is to make sure that the default address never changes.    For
  974. example,  you might adopt the convention that address 1 on each subnet
  975. is the default gateway for  that  subnet.    For  example,  on  subnet
  976. 128.6.7,  the  default  gateway  would  always  be 128.6.7.1.  If that
  977. gateway is ever removed, some other gateway  is  given  that  address.
  978. (There  must  always  be  at least one gateway left to give it to.  If
  979. there isn't, you are completely cut off anyway.)
  980.  
  981. The biggest problem with the description given so far is that it tells
  982. you how to add routes but not how to get rid of them.  What happens if
  983. a gateway goes down?  You want traffic to  be  redirected  back  to  a
  984. gateway  that is up.  Unfortunately, a gateway that has crashed is not
  985. going to issue Redirects.  One solution is  to  choose  very  reliable
  986. gateways.  If they crash very seldom, this may not be a problem.  Note
  987. that Redirects can be used to handle some kinds  of  network  failure.
  988. If  a  line goes down, your current route may no longer be a good one.
  989. As long as the gateway to which  you  are  talking  is  still  up  and
  990. talking  to you, it can simply issue a Redirect to the gateway that is
  991. now the best one.  However you still need a way to detect  failure  of
  992. one of the gateways that you are talking to directly.
  993.  
  994.                                   15
  995.  
  996.  
  997.  
  998. The  best  approach  for  handling  failed gateways is for your TCP/IP
  999. implementation to detect routes  that  have  failed.    TCP  maintains
  1000. various timers that allow the software to detect when a connection has
  1001. broken.  When this happens, one good approach is  to  mark  the  route
  1002. down, and go back to the default gateway.  A similar approach can also
  1003. be used to handle failures in the default gateway.  If you  have  mark
  1004. two  gateways  as  default,  then  the  software  should be capable of
  1005. switching  when  connections  using  one  of   them   start   failing.
  1006. Unfortunately,  some  common TCP/IP implementations do not mark routes
  1007. as down and change to new ones.  (In particular Berkeley 4.2 Unix does
  1008. not.)    However  Berkeley 4.3 Unix does do this, and as other vendors
  1009. begin to base products  on  4.3  rather  than  4.2,  this  ability  is
  1010. expected to be more common.
  1011.  
  1012.  
  1013.  
  1014. 4.4 Other ways for hosts to find routes
  1015.  
  1016.  
  1017. As  long  as  your  TCP/IP  implementations handle failing connections
  1018. properly, establishing one or more default routes in the configuration
  1019. file  is  likely  to  be  the simplest way to handle routing.  However
  1020. there are two other routing approaches that are worth considering  for
  1021. special situations:
  1022.  
  1023.    - spying on the routing protocol
  1024.  
  1025.    - using proxy ARP
  1026.  
  1027.  
  1028.  
  1029. 4.4.1 Spying on Routing
  1030.  
  1031.  
  1032. Gateways  generally  have  a  special  protocol  that  they  use among
  1033. themselves.    Note  that  redirects  cannot  be  used  by   gateways.
  1034. Redirects  are  simply ways for gateways to tell "dumb" hosts to use a
  1035. different gateway.  The  gateways  themselves  must  have  a  complete
  1036. picture of the network, and a way to compute the optimal route to each
  1037. subnet.    Generally  they  maintain  this   picture   by   exchanging
  1038. information  among  themselves.    There are several different routing
  1039. protocols in use for this purpose.  One way for  a  computer  to  keep
  1040. track  of  gateways  is  for  it  to listen to the gateways' messages.
  1041. There is software available for this purpose for most  of  the  common
  1042. routing  protocols.    When  you  run  this  software,  it maintains a
  1043. complete picture of the  network,  just  as  the  gateways  do.    The
  1044. software  is  generally  designed  to maintain your computer's routing
  1045. tables dynamically, so that datagrams are always sent  to  the  proper
  1046. gateway.  In effect, the routing software issues the equivalent of the
  1047. Unix "route add" and "route delete" commands as the  network  topology
  1048. changes.    Generally this results in a complete routing table, rather
  1049. than one that depends upon default routes.   (This  assumes  that  the
  1050. gateways  themselves  maintain  a  complete table.  Sometimes gateways
  1051. keep track of your campus network completely, but use a default  route
  1052. for all off-campus networks, etc.)
  1053.                                   16
  1054.  
  1055.  
  1056.  
  1057. Running  routing  software on each host does in some sense "solve" the
  1058. routing problem.  However there are several reasons why  this  is  not
  1059. normally  recommended  except  as  a  last  resort.   The most serious
  1060. problem is that this reintroduces configuration options that  must  be
  1061. kept  up to date on each host.  Any computer that wants to participate
  1062. in the protocol among the gateways will need to configure its software
  1063. compatibly   with   the   gateways.      Modern  gateways  often  have
  1064. configuration options that are  complex  compared  with  those  of  an
  1065. individual host.  It is undesirable to spread these to every host.
  1066.  
  1067. There  is  a  somewhat  more  specialized problem that applies only to
  1068. diskless computers.  By its very nature, a diskless  computer  depends
  1069. upon the network and file servers to load programs and to do swapping.
  1070. It is dangerous for  diskless  computers  to  run  any  software  that
  1071. listens  to  network  broadcasts.   Routing software generally depends
  1072. upon broadcasts.  For example,  each  gateway  on  the  network  might
  1073. broadcast  its  routing  tables  every  30  seconds.  The problem with
  1074. diskless nodes is that the software to listen to these broadcasts must
  1075. be loaded over the network.  On a busy computer, programs that are not
  1076. used for a few seconds will be swapped or paged out.   When  they  are
  1077. activated  again,  they  must  be  swapped  or  paged  in.  Whenever a
  1078. broadcast is sent, every computer on the network needs to activate the
  1079. routing  software  in order to process the broadcast.  This means that
  1080. many diskless computers will be doing swapping or paging at  the  same
  1081. time.    This  is likely to cause a temporary overload of the network.
  1082. Thus it is very unwise for diskless machines to run any software  that
  1083. requires them to listen to broadcasts.
  1084.  
  1085.  
  1086.  
  1087. 4.4.2 Proxy ARP
  1088.  
  1089.  
  1090. Proxy  ARP  is  an alternative technique for letting gateways make all
  1091. the routing decisions.  It is applicable to any broadcast network that
  1092. uses  ARP  or  a similar technique for mapping Internet addresses into
  1093. network-specific  addresses  such  as  Ethernet   addresses.      This
  1094. presentation  will  assume  Ethernet.    Other  network  types  can be
  1095. acccomodated if you replace "Ethernet address"  with  the  appropriate
  1096. network-specific  address,  and ARP with the protocol used for address
  1097. mapping by that network type.
  1098.  
  1099. In many ways proxy ARP it is similar to  using  a  default  route  and
  1100. redirects, however it uses a different mechanism to communicate routes
  1101. to the host.  With redirects, a full routing table is used.    At  any
  1102. given moment, the host knows what gateways it is routing datagrams to.
  1103. With proxy ARP, you dispense with  explicit  routing  tables,  and  do
  1104. everything  at the level of Ethernet addresses.  Proxy ARP can be used
  1105. for all destinations, only for destinations within your network, or in
  1106. various  combinations.   It will be simplest to explain it as used for
  1107. all addresses.  To do this, you instruct  the  host  to  pretend  that
  1108. every  computer  in  the  world  is  attached  directly  to your local
  1109. Ethernet.  On Unix, this would be done using a command
  1110.  
  1111.       route add default 128.6.4.2 0
  1112.                                   17
  1113.  
  1114.  
  1115.  
  1116. where 128.6.4.2 is assumed to be the Internet address  of  your  host.
  1117. As  explained  above,  the  metric of 0 causes everything that matches
  1118. this route to be sent directly on the local Ethernet.
  1119.  
  1120. When a datagram is to be sent to a local  Ethernet  destination,  your
  1121. computer  needs  to  know the Ethernet address of the destination.  In
  1122. order to find that, it uses something generally called the ARP  table.
  1123. This  is  simply  a mapping from Internet address to Ethernet address.
  1124. Here's a typical ARP table.  (On our system, it is displayed using the
  1125. command "arp -a".)
  1126.  
  1127.     FOKKER.RUTGERS.EDU (128.6.5.16) at 8:0:20:0:8:22 temporary
  1128.     CROSBY.RUTGERS.EDU (128.6.5.48) at 2:60:8c:49:50:63 temporary
  1129.     CAIP.RUTGERS.EDU (128.6.4.16) at 8:0:8b:0:1:6f temporary
  1130.     DUDE.RUTGERS.EDU (128.6.20.16) at 2:7:1:0:eb:cd temporary
  1131.     W20NS.MIT.EDU (18.70.0.160) at 2:7:1:0:eb:cd temporary
  1132.     OBERON.USC.EDU (128.125.1.1) at 2:7:1:2:18:ee temporary
  1133.     gatech.edu (128.61.1.1) at 2:7:1:0:eb:cd temporary
  1134.     DARTAGNAN.RUTGERS.EDU (128.6.5.65) at 8:0:20:0:15:a9 temporary
  1135.  
  1136. Note  that  it  is  simply  a  list  of  Internet  addresses  and  the
  1137. corresponding Ethernet address.  The "temporary"  indicates  that  the
  1138. entry  was added dynamically using ARP, rather than being put into the
  1139. table manually.
  1140.  
  1141. If there is an entry for the address in the ARP table, the datagram is
  1142. simply  put  on  the Ethernet with the corresponding Ethernet address.
  1143. If not, an "ARP request" is broadcast, asking for the destination host
  1144. to  identify  itself.   This request is in effect a question "will the
  1145. host with Internet  address  128.6.4.194  please  tell  me  what  your
  1146. Ethernet address is?".  When a response comes back, it is added to the
  1147. ARP table, and future datagrams  for  that  destination  can  be  sent
  1148. without delay.
  1149.  
  1150. This  mechanism  was  originally  designed  only  for  use  with hosts
  1151. attached directly to a single Ethernet.  If you need to talk to a host
  1152. on  a different Ethernet, it was assumed that your routing table would
  1153. direct you to a gateway.    The  gateway  would  of  course  have  one
  1154. interface  on  your Ethernet.  Your computer would then end up looking
  1155. up the address of that gateway using  ARP.    It  would  generally  be
  1156. useless  to  expect  ARP to work directly with a computer on a distant
  1157. network.  Since it isn't on the same  Ethernet,  there's  no  Ethernet
  1158. address you can use to send datagrams to it.  And when you send an ARP
  1159. request for it, there's nobody to answer the request.
  1160.  
  1161. Proxy ARP is based on the  concept  that  the  gateways  will  act  as
  1162. proxies  for  distant  hosts.    Suppose  you  have  a host on network
  1163. 128.6.5, with address 128.6.5.2.  (computer A  in  diagram  below)  It
  1164. wants  to send a datagram to host 128.6.4.194, which is on a different
  1165. Ethernet (subnet 128.6.4). (computer C in diagram below)  There  is  a
  1166. gateway  connecting  the  two subnets, with address 128.6.5.1 (gateway
  1167. R):
  1168.  
  1169.  
  1170.  
  1171.                                   18
  1172.  
  1173.  
  1174.  
  1175.               network 1               network 2
  1176.                128.6.5                 128.6.4
  1177.         ============================  ==================
  1178.           |              |        |    |      |    |
  1179.        ___|______   _____|____  __|____|__  __|____|____
  1180.        128.6.5.2    128.6.5.3   128.6.5.1   128.6.4.194
  1181.                                 128.6.4.1
  1182.        __________   __________  __________  ____________
  1183.        computer A   computer B   gateway R   computer C
  1184.  
  1185.  
  1186. Now suppose computer A sends an ARP request for computer  C.  C  isn't
  1187. able  to  answer  for  itself.  It's on a different network, and never
  1188. even sees the ARP request.  However gateway R can act on  its  behalf.
  1189. In  effect,  your  computer  asks "will the host with Internet address
  1190. 128.6.4.194 please tell me what your Ethernet address  is?",  and  the
  1191. gateway   says  "here  I  am,  128.6.4.194  is  2:7:1:0:eb:cd",  where
  1192. 2:7:1:0:eb:cd is actually the Ethernet address of the gateway.    This
  1193. bit  of  illusion  works  just  fine.    Your  host  now  thinks  that
  1194. 128.6.4.194  is  attached  to  the   local   Ethernet   with   address
  1195. 2:7:1:0:eb:cd.    Of  course it isn't.  But it works anyway.  Whenever
  1196. there's a datagram to be sent to 128.6.4.194, your host  sends  it  to
  1197. the specified Ethernet address.  Since that's the address of a gateway
  1198. R, the  gateway  gets  the  packet.    It  then  forwards  it  to  the
  1199. destination.
  1200.  
  1201. Note that the net effect is exactly the same as having an entry in the
  1202. routing table saying  to  route  destination  128.6.4.194  to  gateway
  1203. 128.6.5.1:
  1204.  
  1205.     128.6.4.194          128.6.5.1           UGH          pe0
  1206.  
  1207. except  that  instead  of  having the routing done at the level of the
  1208. routing table, it is done at the level of the ARP table.
  1209.  
  1210. Generally it's better to use the routing  table.    That's  what  it's
  1211. there for.  However here are some cases where proxy ARP makes sense:
  1212.  
  1213.    - when you have a host that does not implement subnets
  1214.  
  1215.    - when you have a host that does not respond properly to redirects
  1216.  
  1217.    - when you do not want to have to choose a specific default gateway
  1218.  
  1219.    - when your software is unable to recover from a failed route
  1220.  
  1221. The  technique  was first designed to handle hosts that do not support
  1222. subnets.  Suppose that you have a subnetted network.  For example, you
  1223. have  chosen  to break network 128.6 into subnets, so that 128.6.4 and
  1224. 128.6.5 are separate.  Suppose you  have  a  computer  that  does  not
  1225. understand  subnets.    It  will  assume that all of 128.6 is a single
  1226. network.  Thus it will be difficult to establish routing table entries
  1227. to  handle  the  configuration  above.    You  can't tell it about the
  1228. gateway explicitly using "route add 128.6.4.0 128.6.5.1  1"  Since  it
  1229. thinks  all of 128.6 is a single network, it can't understand that you
  1230.                                   19
  1231.  
  1232.  
  1233.  
  1234. are trying to tell it where to send  one  subnet.    It  will  instead
  1235. interpret  this command as an attempt to set up a host route to a host
  1236. who address is 128.6.4.0.  The only thing that would work would be  to
  1237. establish  explicit  host  routes  for  every individual host on every
  1238. other subnet.  You can't depend upon default gateways and redirects in
  1239. this  situation either.  Suppose you said "route add default 128.6.5.1
  1240. 1".  This would establish the gateway 128.6.5.1 as a default.  However
  1241. the  system wouldn't use it to send packets to other subnets.  Suppose
  1242. the host is 128.6.5.2, and wants to send a  datagram  to  128.6.4.194.
  1243. Since  the destination is part of 128.6, your computer considers it to
  1244. be on the same network as itself, and doesn't bother  to  look  for  a
  1245. gateway.
  1246.  
  1247. Proxy  ARP  solves  this  problem by making the world look the way the
  1248. defective implementation expects it to look.  Since  the  host  thinks
  1249. all  other  subnets  are part of its own network, it will simply issue
  1250. ARP requests for them.  It expects to get  back  an  Ethernet  address
  1251. that  can  be used to establish direct communications.  If the gateway
  1252. is practicing proxy ARP, it will respond with the  gateway's  Ethernet
  1253. address.    Thus  datagrams  are  sent  to the gateway, and everything
  1254. works.
  1255.  
  1256. As you can see, no specific configuration is need  to  use  proxy  ARP
  1257. with a host that doesn't understand subnets.  All you need is for your
  1258. gateways to implement proxy ARP.    In  order  to  use  it  for  other
  1259. purposes, you must explicitly set up the routing table to cause ARP to
  1260. be used.  By default, TCP/IP implementations will  expect  to  find  a
  1261. gateway  for any destination that is on a different network.  In order
  1262. to make them issue ARP's, you must explicitly  install  a  route  with
  1263. metric 0, as in the example "route add default 128.6.5.2 0".
  1264.  
  1265. It  is  obvious  that  proxy ARP is reasonable in situations where you
  1266. have hosts that don't understand subnets.  Some comments may be needed
  1267. on  the  other situations.  Generally TCP/IP implementations do handle
  1268. ICMP redirects properly.  Thus it is normally practical to  set  up  a
  1269. default  route  to  some gateway, and depend upon the gateway to issue
  1270. redirects for  destinations  that  should  use  a  different  gateway.
  1271. However in case you ever run into an implementation that does not obey
  1272. redirects, or cannot be configured to have a default gateway, you  may
  1273. be  able  to  make things work by depending upon proxy ARP.  Of course
  1274. this requires that you be able to configure the host  to  issue  ARP's
  1275. for  all  destinations.    You  will  need  to  read the documentation
  1276. carefully to see exactly what  routing  features  your  implementation
  1277. has.
  1278.  
  1279. Sometimes  you  may  choose  to depend upon proxy ARP for convenience.
  1280. The problem with routing tables is that you have  to  configure  them.
  1281. The simplest configuration is simply to establish a default route, but
  1282. even there you have to supply some  equivalent  to  the  Unix  command
  1283. "route  add  default  ...".    Should you change the addresses of your
  1284. gateways, you have to modify this command on all  of  your  hosts,  so
  1285. that  they  point to the new default gateway.  If you set up a default
  1286. route that depends upon proxy ARP (i.e. has metric 0), you won't  have
  1287. to  change  your configuration files when gateways change.  With proxy
  1288. ARP, no gateway addresses are  given  explicitly.    Any  gateway  can
  1289.                                   20
  1290.  
  1291.  
  1292.  
  1293. respond to the ARP request, no matter what its address.
  1294.  
  1295. In  order  to  save  you  from having to do configuration, some TCP/IP
  1296. implementations default to using ARP when they have  no  other  route.
  1297. The  most  flexible implementations allow you to mix strategies.  That
  1298. is, if you have specified a route  for  a  particular  network,  or  a
  1299. default route, they will use that route.  But if there is no route for
  1300. a destination, they will treat it as local, and issue an ARP  request.
  1301. As  long as your gateways support proxy ARP, this allows such hosts to
  1302. reach any destination without any need for routing tables.
  1303.  
  1304. Finally, you may choose to use proxy ARP because  it  provides  better
  1305. recovery  from  failure.  This choice is very much dependent upon your
  1306. implementation.  The next section will discuss the tradeoffs  in  more
  1307. detail.
  1308.  
  1309. In  situations  where  there  are  several  gateways  attached to your
  1310. network, you may wonder how proxy ARP allows you to  choose  the  best
  1311. one.    As  described  above,  your  computer simply sends a broadcast
  1312. asking for the Ethernet address for a destination.   We  assumed  that
  1313. the  gateways  would be set up to respond to this broadcast.  If there
  1314. is more than one  gateway,  this  requires  coordination  among  them.
  1315. Ideally,  the  gateways  will  have  a complete picture of the network
  1316. topology.  Thus they are able to determine the best  route  from  your
  1317. host  to any destination.  If the gateway coordinate among themselves,
  1318. it should be possible for the best gateway  to  respond  to  your  ARP
  1319. request.    In  practice,  it  may  not always be possible for this to
  1320. happen.  It is fairly easy to design algorithms to  prevent  very  bad
  1321. routes.  For example, consider the following situation:
  1322.  
  1323.           1             2            3
  1324.         -------  A  ----------  B ----------
  1325.  
  1326. 1,  2, and 3 are networks.  A and B are gateways, connecting network 2
  1327. to 1 or 3.  If a host on network 2 wants to talk to a host on  network
  1328. 1,  it  is  fairly  easy  for  gateway  A to decide to answer, and for
  1329. gateway B to decide not to.  Here's  how:  if  gateway  B  accepted  a
  1330. datagram  for  network 1, it would have to forward it to gateway A for
  1331. delivery.  This would mean that it would take a packet from network  2
  1332. and  send it right back out on network 2.  It is very easy to test for
  1333. routes that involve this sort of circularity.  It is  much  harder  to
  1334. deal with a situation such as the following:
  1335.  
  1336.                          1
  1337.                   ---------------
  1338.                     A        B
  1339.                     |        | 4
  1340.                     |        |
  1341.                   3 |        C
  1342.                     |        |
  1343.                     |        | 5
  1344.                     D        E
  1345.                   ---------------
  1346.                          2
  1347.  
  1348.                                   21
  1349.  
  1350.  
  1351.  
  1352. Suppose  a  computer  on  network 1 wants to send a datagram to one on
  1353. network 2.  The route via A and D is probably better, because it  goes
  1354. through  only one intermediate network (3).  It is also possible to go
  1355. via B, C, and E, but that path  is  probably  slightly  slower.    Now
  1356. suppose  the  computer  on  network  1  sends  an  ARP  request  for a
  1357. destination on 2.  It is likely that A and B will both respond to that
  1358. request.    B  is not quite as good a route as A. However it is not so
  1359. bad as the case above.  B won't have to send the datagram  right  back
  1360. out  onto  network  1.    It  is unable to determine there is a better
  1361. alternative  route  without  doing  a  significant  amount  of  global
  1362. analysis  on  the network.  This may not be practical in the amount of
  1363. time available to process an ARP request.
  1364.  
  1365.  
  1366.  
  1367. 4.4.3 Moving to New Routes After Failures
  1368.  
  1369.  
  1370. In principle, TCP/IP routing is capable of handling line failures  and
  1371. gateway  crashes.    There  are  various  mechanisms to adjust routing
  1372. tables and ARP tables to keep them up to date.    Unfortunately,  many
  1373. major  implementations  of  TCP/IP  have  not implemented all of these
  1374. mechanisms.  The net result is that you have to look carefully at  the
  1375. documentation  for  your  implementation,  and  consider what kinds of
  1376. failures are most likely.  You then have to  choose  a  strategy  that
  1377. will  work  best  for your site.  The basic choices for finding routes
  1378. have all been listed above:  spying on the gateways' routing protocol,
  1379. setting  up  a  default  route and depending upon redirects, and using
  1380. proxy ARP.  These methods all have their own  limitations  in  dealing
  1381. with a changing network.
  1382.  
  1383. Spying on the gateways' routing protocol is theoretically the cleanest
  1384. solution.  Assuming that the gateways use good routing technology, the
  1385. tables  that  they  broadcast  contain  enough information to maintain
  1386. optimal routes to all destinations.  Should something in  the  network
  1387. change  (a  line  or  a  gateway  goes down), this information will be
  1388. reflected in the tables, and the routing  software  will  be  able  to
  1389. update the hosts' routing tables appropriately.  The disadvantages are
  1390. entirely practical.  However in some situations the robustness of this
  1391. approach may outweight the disadvantages.  To summarize the discussion
  1392. above, the disadvantages are:
  1393.  
  1394.    - If  the  gateways  are  using  sophisticated  routing  protocols,
  1395.      configuration may be fairly complex.  Thus you will be faced with
  1396.      setting up and maintaining configuration files on every host.
  1397.  
  1398.    - Some gateways use proprietary routing protocols.  In  this  case,
  1399.      you  may  not  be  able  to  find  software  for  your hosts that
  1400.      understands them.
  1401.  
  1402.    - If your hosts are diskless, there can be very serious performance
  1403.      problems associated with listening to routing broadcasts.
  1404.  
  1405. Some  gateways  may  be  able  to  convert from their internal routing
  1406. protocol to a simpler one for use by your hosts.  This  could  largely
  1407.                                   22
  1408.  
  1409.  
  1410.  
  1411. bypass  the  first two disadvantages.  Currently there is no known way
  1412. to get around the third one.
  1413.  
  1414. The problems with default routes/redirects  and  with  proxy  ARP  are
  1415. similar:  they  both  have trouble dealing with situations where their
  1416. table entries no longer apply.   The  only  real  difference  is  that
  1417. different  tables  are involved.  Suppose a gateway goes down.  If any
  1418. of your current routes are using that gateway, you may be in  trouble.
  1419. If  you  are depending upon the routing table, the major mechanism for
  1420. adjusting routes is the redirect.  This works fine in two  situations:
  1421.  
  1422.    - where  the  default  gateway  is not the best route.  The default
  1423.      gateway can direct you to a better gateway
  1424.  
  1425.    - where a distant line or gateway fails.  If this changes the  best
  1426.      route,  the  current gateway can redirect you to the gateway that
  1427.      is now best
  1428.  
  1429. The case it does not protect you against is where the gateway that you
  1430. are currently sending your datagrams to crashes.  Since it is down, it
  1431. is unable to redirect you to another gateway.  In many cases, you  are
  1432. also  unprotected  if  your  default  gateway  goes  down, since there
  1433. routing starts by sending to the default gateway.
  1434.  
  1435. The situation with proxy ARP is similar.  If the  gateways  coordinate
  1436. themselves  properly,  the  right  one  will  respond  initially.   If
  1437. something elsewhere in  the  network  changes,  the  gateway  you  are
  1438. currently  issuing  can  issue  a  redirect  to  a new gateway that is
  1439. better.  (It is usually possible to use redirects to  override  routes
  1440. established  by  proxy  ARP.)    Again, the case you are not protected
  1441. against is where the gateway you are currently using crashes.    There
  1442. is  no  equivalent  to failure of a default gateway, since any gateway
  1443. can respond to the ARP request.
  1444.  
  1445. So the big problem is that failure of a gateway you are using is  hard
  1446. to  recover  from.   It's hard because the main mechanism for changing
  1447. routes is the redirect,  and  a  gateway  that  is  down  can't  issue
  1448. redirects.    Ideally,  this  problem should be handled by your TCP/IP
  1449. implementation, using timeouts.  If a computer stops getting response,
  1450. it  should  cancel the existing route, and try to establish a new one.
  1451. Where you are using a  default  route,  this  means  that  the  TCP/IP
  1452. implementation  must  be  able  to  declare a route as down based on a
  1453. timeout.  If you have been redirected to a  non-default  gateway,  and
  1454. that  route is declared down, traffic will return to the default.  The
  1455. default gateway can then begin handling the traffic, or redirect it to
  1456. a  different  gateway.    To  handle  failure of a default gateway, it
  1457. should be possible to have more than one default.  If one is  declared
  1458. down,  another  will  be used.  Together, these mechanisms should take
  1459. care of any failure.
  1460.  
  1461. Similar mechanisms can be used by systems that depend upon proxy  ARP.
  1462. If a connection is timing out, the ARP table entry that it uses should
  1463. be cleared.  This will cause a new ARP request, which can  be  handled
  1464. by a gateway that is still up.  A simpler mechanism would simply be to
  1465. time out all ARP entries after some period.  Since making  a  new  ARP
  1466.                                   23
  1467.  
  1468.  
  1469.  
  1470. request  has  a very low overhead, there's no problem with removing an
  1471. ARP entry even if it is still good.  The next time a datagram is to be
  1472. sent,  a  new  request  will  be  made.  The response is normally fast
  1473. enough that users will not even notice the delay.
  1474.  
  1475. Unfortunately,  many  common  implementations   do   not   use   these
  1476. strategies.  In Berkeley 4.2, there is no automatic way of getting rid
  1477. of any kind of entry, either routing or ARP.  They do  not  invalidate
  1478. routes  on  timeout  nor  ARP  entries.  ARP entries last forever.  If
  1479. gateway crashes are a significant problem, there may be no choice  but
  1480. to  run  software  that  listens to the routing protocol.  In Berkeley
  1481. 4.3, routing entries are removed when  TCP  connections  are  failing.
  1482. ARP  entries  are  still  not  removed.   This makes the default route
  1483. strategy more attractive for 4.3 than proxy ARP.  Having more than one
  1484. default  route  may  also allow for recovery from failure of a default
  1485. gateway.  Note however that 4.3 only handles timeout  for  connections
  1486. using TCP.  If a route is being used only by services based on UDP, it
  1487. will not recover from gateway failure.  While the "traditional" TCP/IP
  1488. services  use  TCP,  network  file  systems  generally  do  not.  Thus
  1489. 4.3-based systems still  may  not  always  be  able  to  recover  from
  1490. failure.
  1491.  
  1492. In  general,  you  should  examine  your  implementation  in detail to
  1493. determine what sort of error recovery strategy it uses.  We hope  that
  1494. the  discussion in this section will then help you choose the best way
  1495. of dealing with routing.
  1496.  
  1497. There is one more strategy that some older implementations use.  It is
  1498. strongly  discouraged,  but we mention it here so you can recognize it
  1499. if you see it.  Some implementations detect gateway failure by  taking
  1500. active  measure to see what gateways are up.  The best version of this
  1501. is based on a list of all gateways that are currently in use.    (This
  1502. can  be  determined  from  the routing table.)  Every minute or so, an
  1503. echo request datagram is sent to each such  gateway.    If  a  gateway
  1504. stops responding to echo requests, it is declared down, and all routes
  1505. using it revert to the default.   With  such  an  implementation,  you
  1506. normally supply more than one default gateway.  If the current default
  1507. stops responding, an alternate is chosen.  In some cases,  it  is  not
  1508. even  necessary  to  choose an explicit default gateway.  The software
  1509. will  randomly  choose  any  gateway  that  is   responding.      This
  1510. implementation  is  very  flexible  and  recovers  well from failures.
  1511. However a large network full of such implementations will waste a  lot
  1512. of  bandwidth  on  the  echo  datagrams  that are used to test whether
  1513. gateways  are  up.    This  is  the  reason  that  this  strategy   is
  1514. discouraged.
  1515.  
  1516.  
  1517.  
  1518. 5. Bridges and Gateways
  1519.  
  1520.  
  1521. This  section  will  deal  in  more detail with the technology used to
  1522. construct larger networks.  It  will  focus  particularly  on  how  to
  1523. connect  together  multiple  Ethernets,  token rings, etc.  These days
  1524. most networks are hierarchical.  Individual hosts attach to local-area
  1525.                                   24
  1526.  
  1527.  
  1528.  
  1529. networks  such  as  Ethernet or token ring.  Then those local networks
  1530. are connected via some combination of backbone networks and  point  to
  1531. point  links.    A  university might have a network that looks in part
  1532. like this:
  1533.  
  1534.      ________________________________
  1535.      |   net 1      net 2    net 3  |        net 4            net 5
  1536.      | ---------X---------X-------- |      --------         --------
  1537.      |                         |    |         |                 |
  1538.      |  Building A             |    |         |                 |
  1539.      |               ----------X--------------X-----------------X
  1540.      |                              |  campus backbone network  :
  1541.      |______________________________|                           :
  1542.                                                          serial :
  1543.                                                            line :
  1544.                                                          -------X-----
  1545.                                                              net  6
  1546.  
  1547. Nets 1, 2 and 3 are in one building.  Nets 4 and 5  are  in  different
  1548. buildings  on  the  same  campus.  Net 6 is in a somewhat more distant
  1549. location.  The diagram above shows nets 1, 2, and  3  being  connected
  1550. directly,  with switches that handle the connections being labelled as
  1551. "X".  Building A is connected to  the  other  buildings  on  the  same
  1552. campus  by  a backbone network.  Note that traffic from net 1 to net 5
  1553. takes the following path:
  1554.  
  1555.    - from 1 to 2 via the direct connection between those networks
  1556.  
  1557.    - from 2 to 3 via another direct connection
  1558.  
  1559.    - from 3 to the backbone network
  1560.  
  1561.    - across the backbone network from building A to  the  building  in
  1562.      which net 5 is housed
  1563.  
  1564.    - from the backbone network to net 5
  1565.  
  1566. Traffic  for  net  6 would additionally pass over a serial line.  With
  1567. the setup as shown, the same switch  is  being  used  to  connect  the
  1568. backbone  network  to net 5 and to the serial line.  Thus traffic from
  1569. net 5 to net 6 would not need to go through the backbone, since  there
  1570. is a direct connection from net 5 to the serial line.
  1571.  
  1572. This section is largely about what goes in those "X"'s.
  1573.  
  1574.  
  1575.  
  1576. 5.1 Alternative Designs
  1577.  
  1578.  
  1579. Note  that  there  are alternatives to the sort of design shown above.
  1580. One is to use point to point lines or switched lines directly to  each
  1581. host.   Another is to use a single-level of network technology that is
  1582. capable of handling both local and long-haul networking.
  1583.  
  1584.                                   25
  1585.  
  1586.  
  1587.  
  1588. 5.1.1 A mesh of point to point lines
  1589.  
  1590.  
  1591. Rather than connecting hosts to a local network such as Ethernet,  and
  1592. then   interconnecting  the  Ethernets,  it  is  possible  to  connect
  1593. long-haul serial lines directly to the individual computers.  If  your
  1594. network   consists   primarily  of  individual  computers  at  distant
  1595. locations, this might make sense.  Here would be  a  small  design  of
  1596. that type.
  1597.  
  1598.           computer 1                computer 2             computer 3
  1599.               |                         |                      |
  1600.               |                         |                      |
  1601.               |                         |                      |
  1602.           computer 4 -------------- computer 5 ----------- computer 6
  1603.  
  1604. In  the design shown earlier, the task of routing datagrams around the
  1605. network is handled by special-purpose switching units shown as  "X"'s.
  1606. If  you  run lines directly between pairs of hosts, your hosts will be
  1607. doing this sort of routing and switching,  as  well  as  their  normal
  1608. computing.    Unless  you  run  lines  directly  between every pair of
  1609. computers, some systems will end up handling traffic for  others.  For
  1610. example,  in this design, traffic from 1 to 3 will go through 4, 5 and
  1611. 6.  This is certainly possible, since most TCP/IP implementations  are
  1612. capable of forwarding datagrams.  If your network is of this type, you
  1613. should think of your hosts as also acting as gateways.   Much  of  the
  1614. discussion  below  on  configuring  gateways will apply to the routing
  1615. software that you run on your hosts.  This sort  of  configuration  is
  1616. not as common as it used to be, for two reasons:
  1617.  
  1618.    - Most large networks have more than one computer per location.  In
  1619.      this case it is less expensive to set up a local network at  each
  1620.      location than to run point to point lines to each computer.
  1621.  
  1622.    - Special-purpose  switching  units have become less expensive.  It
  1623.      often makes sense to offload the routing and communications tasks
  1624.      to a switch rather than handling it on the hosts.
  1625.  
  1626. It is of course possible to have a network that mixes the two kinds of
  1627. techology.  In this case,  locations  with  more  equipment  would  be
  1628. handled  by  a hierarchical system, with local-area networks connected
  1629. by switches.  Remote locations with a single computer would be handled
  1630. by  point  to  point lines going directly to those computers.  In this
  1631. case the routing software used on the remote computers would  have  to
  1632. be  compatible  with that used by the switches, or there would need to
  1633. be a gateway between the two parts of the network.
  1634.  
  1635. Design decisions of this type are typically made after  an  assessment
  1636. of  the  level  of network traffic, the complexity of the network, the
  1637. quality of routing software available for the hosts, and  the  ability
  1638. of the hosts to handle extra network traffic.
  1639.  
  1640.  
  1641.  
  1642.  
  1643.                                   26
  1644.  
  1645.  
  1646.  
  1647. 5.1.2 Circuit switching technology
  1648.  
  1649.  
  1650. Another  alternative  to  the hierarchical LAN/backbone approach is to
  1651. use circuit switches connected to each individual computer.   This  is
  1652. really  a  variant  of  the  point  to point line technique, where the
  1653. circuit switch allows each system to have what  amounts  to  a  direct
  1654. line to every other system.  This technology is not widely used within
  1655. the TCP/IP community, largely because the TCP/IP protocols assume that
  1656. the  lowest  level  handles  isolated  datagrams.    When a continuous
  1657. connection  is  needed,  higher  network  layers  maintain  it   using
  1658. datagrams.    This  datagram-oriented  technology  does  not  match  a
  1659. circuit-oriented environment very closely.  In order  to  use  circuit
  1660. switching  technology,  the IP software must be modified to be able to
  1661. build and tear down virtual circuits as appropriate.  When there is  a
  1662. datagram  for a given destination, a virtual circuit must be opened to
  1663. it.  The virtual circuit would  be  closed  when  there  has  been  no
  1664. traffic  to  that  destination  for  some time.  The major use of this
  1665. technology is for  the  DDN  (Defense  Data  Network).    The  primary
  1666. interface  to  the  DDN is based on X.25.  This network appears to the
  1667. outside as a distributed X.25 network.  TCP/IP software  intended  for
  1668. use with the DDN must do precisely the virtual circuit management just
  1669. described.     Similar   techniques   could   be   used   with   other
  1670. circuit-switching  technologies, e.g. ATT's DataKit, although there is
  1671. almost no software currently available to support this.
  1672.  
  1673.  
  1674.  
  1675. 5.1.3 Single-level networks
  1676.  
  1677.  
  1678. In some cases new developments in wide-area networks can eliminate the
  1679. need  for hierarchical networks.  Early hierarchical networks were set
  1680. up because the only convenient  network  technology  was  Ethernet  or
  1681. other  LAN's, and those could not span distances large enough to cover
  1682. an entire campus.  Thus it  was  necessary  to  use  serial  lines  to
  1683. connect  LAN's  in  various  locations.    It  is now possible to find
  1684. network technology whose characteristics are similar to Ethernet,  but
  1685. where  a  single  network  can  span a campus.  Thus it is possible to
  1686. think of using a single large network, with no hierarchical structure.
  1687.  
  1688. The  primary  limitations  of  a  large   single-level   network   are
  1689. performance  and  reliability  considerations.  If a single network is
  1690. used  for  the  entire  campus,  it  is  very  easy  to  overload  it.
  1691. Hierarchical   networks  can  handle  a  larger  traffic  volume  than
  1692. single-level networks if traffic patterns have a reasonable amount  of
  1693. locality.  That is, in many applications, traffic within an individual
  1694. department tends to be greater than traffic among departments.
  1695.  
  1696. Let's look at a concrete example.  Suppose there are  10  departments,
  1697. each of which generate 1 Mbit/sec of traffic.  Suppose futher than 90%
  1698. of that traffic is to other systems within the  department,  and  only
  1699. 10%  is to other departments.  If each department has its own network,
  1700. that network only needs to handle 1 Mbit/sec.   The  backbone  network
  1701. connecting  the  department also only needs 1 Mbit/sec capacity, since
  1702.                                   27
  1703.  
  1704.  
  1705.  
  1706. it is handling 10% of 1 Mbit from each department.  In order to handle
  1707. this  situation  with  a  single wide-area network, that network would
  1708. have  to  be  able  to  handle  the  simultaneous  load  from  all  10
  1709. departments, which would be 10 Mbit/sec.
  1710.  
  1711. The   second  limitation  on  single-level  networks  is  reliability,
  1712. maintainability and security.  Wide-area networks are  more  difficult
  1713. to  diagnose  and  maintain than local-area networks, because problems
  1714. can be introduced from any building to which the network is connected.
  1715. They  also  make traffic visible in all locations.  For these reasons,
  1716. it is often sensible to handle local  traffic  locally,  and  use  the
  1717. wide-area  network  only  for  traffic  that  actually must go between
  1718. buildings.  However if you have a situation where  each  location  has
  1719. only  one  or  two  computers, it may not make sense to set up a local
  1720. network at each location, and a single-level network may make sense.
  1721.  
  1722.  
  1723.  
  1724. 5.1.4 Mixed designs
  1725.  
  1726.  
  1727. In practice,  few  large  networks  have  the  luxury  of  adopting  a
  1728. theoretically pure design.
  1729.  
  1730. It is very unlikely that any large network will be able to avoid using
  1731. a hierarchical design.  Suppose we  set  out  to  use  a  single-level
  1732. network.  Even if most buildings have only one or two computers, there
  1733. will be some location where there are enough that a local-area network
  1734. is justified.  The result is a mixture of a single-level network and a
  1735. hierachical network.  Most buildings have  their  computers  connected
  1736. directly  to  the  wide-area  network, as with a single-level network.
  1737. However in one building there is a local-area network which  uses  the
  1738. wide-area  network  as  a  backbone,  connecting to it via a switching
  1739. unit.
  1740.  
  1741. On the other side of the story, even network designers with  a  strong
  1742. commitment  to  hierarchical networks are likely to find some parts of
  1743. the network where it simply doesn't make economic sense to  install  a
  1744. local-area  network.    So  a  host  is put directly onto the backbone
  1745. network, or tied directly to a serial line.
  1746.  
  1747. However you should think carefully before  making  ad  hoc  departures
  1748. from  your  design  philosophy in order to save a few dollars.  In the
  1749. long run, network maintainability is going to depend upon your ability
  1750. to make sense of what is going on in the network.  The more consistent
  1751. your technology is, the more likely you are to be able to maintain the
  1752. network.
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.                                   28
  1762.  
  1763.  
  1764.  
  1765. 5.2 An introduction to alternative switching technologies
  1766.  
  1767.  
  1768. This  section will discuss the characteristics of various technologies
  1769. used to switch datagrams between networks.  In effect, we  are  trying
  1770. to  fill  in  some  details  about the black boxes assumed in previous
  1771. sections.  There are three basic types of switches, generally referred
  1772. to as repeaters, bridges, and gateways, or alternatively as level 1, 2
  1773. and 3 switches (based on the level of the  ISO  model  at  which  they
  1774. operate).    Note however that there are systems that combine features
  1775. of more than one of these, particularly bridges and gateways.
  1776.  
  1777. The most important dimensions on which switches  vary  are  isolation,
  1778. performance, routing and network management facilities.  These will be
  1779. discussed below.
  1780.  
  1781. The most serious difference is between repeaters  and  the  other  two
  1782. types  of  switch.    Until recently, gateways provided very different
  1783. services from bridges.  However these two technologies are now  coming
  1784. closer  together.  Gateways are beginning to adopt the special-purpose
  1785. hardware that has characterized bridges in  the  past.    Bridges  are
  1786. beginning to adopt more sophisticated routing, isolation features, and
  1787. network management, which have characterized  gateways  in  the  past.
  1788. There  are  also systems that can function as both bridge and gateway.
  1789. This means that at the moment, the crucial  decision  may  not  be  to
  1790. decide  whether  to  use  a  bridge  or  a gateway, but to decide what
  1791. features you want in a switch  and  how  it  fits  into  your  overall
  1792. network design.
  1793.  
  1794.  
  1795.  
  1796. 5.2.1 Repeaters
  1797.  
  1798.  
  1799. A repeater is a piece of equipment that connects two networks that use
  1800. the same technology.  It receives every data packet on  each  network,
  1801. and retransmits it onto the other network.  The net result is that the
  1802. two networks have exactly the same  set  of  packets  on  them.    For
  1803. Ethernet or IEEE 802.3 networks there are actually two different kinds
  1804. of repeater.  (Other network technologies may not need  to  make  this
  1805. distinction.)
  1806.  
  1807. A  simple  repeater  operates at a very low level indeed.  Its primary
  1808. purpose is to get around limitations in cable length caused by  signal
  1809. loss or timing dispersion.  It allows you to construct somewhat larger
  1810. networks than you would otherwise be able to construct.    It  can  be
  1811. thought  of  as  simply  a two-way amplifier.  It passes on individual
  1812. bits in the signal, without doing any processing at the packet  level.
  1813. It even passes on collisions.  That is, if a collision is generated on
  1814. one of  the  networks  connected  to  it,  the  repeater  generates  a
  1815. collision  on  the  other  network.  There is a limit to the number of
  1816. repeaters that you can use in a network.  The  basic  Ethernet  design
  1817. requires  that signals must be able to get from one end of the network
  1818. to the other within a specified amount of time.    This  determines  a
  1819. maximum  allowable length.  Putting repeaters in the path does not get
  1820.                                   29
  1821.  
  1822.  
  1823.  
  1824. around this limit.  (Indeed each repeater adds some delay, so in  some
  1825. ways  a repeater makes things worse.)  Thus the Ethernet configuration
  1826. rules limit the number of repeaters that can be in any path.
  1827.  
  1828. A "buffered repeater" operates at the level  of  whole  data  packets.
  1829. Rather  than passing on signals a bit at a time, it receives an entire
  1830. packet from one network into an internal buffer and  then  retransmits
  1831. it  onto  the other network.  It does not pass on collisions.  Because
  1832. such low-level features  as  collisions  are  not  repeated,  the  two
  1833. networks continue to be separate as far as the Ethernet specifications
  1834. are concerned.  Thus there  are  no  restrictions  on  the  number  of
  1835. buffered  repeaters  that can be used.  Indeed there is no requirement
  1836. that both of the networks be of  the  same  type.    However  the  two
  1837. networks  must  be sufficiently similar that they have the same packet
  1838. format.  Generally this means that  buffered  repeaters  can  be  used
  1839. between two networks of the IEEE 802.x family (assuming that they have
  1840. chosen the same address length), or two networks of some other related
  1841. family.    A  pair  of  buffered  repeaters can be used to connect two
  1842. networks via a serial line.
  1843.  
  1844. Buffered repeaters share with simple repeaters the most basic feature:
  1845. they  repeat every data packet that they receive from one network onto
  1846. the other.  Thus the two networks end up with exactly the same set  of
  1847. packets on them.
  1848.  
  1849.  
  1850.  
  1851. 5.2.2 Bridges and gateways
  1852.  
  1853.  
  1854. A  bridge  differs from a buffered repeater primarily in the fact that
  1855. it exercizes some selectivity as to what packets it  forwards  between
  1856. networks.    Generally  the  goal  is  to increase the capacity of the
  1857. system by keeping local traffic confined to the network  on  which  it
  1858. originates.    Only  traffic  intended  for the other network (or some
  1859. other network accessed through it) goes through the bridge.    So  far
  1860. this  description would also apply to a gateway.  Bridges and gateways
  1861. differ in the way they determine what packets to forward.    A  bridge
  1862. uses  only  the  ISO level 2 address.  In the case of Ethernet or IEEE
  1863. 802.x networks, this is the 6-byte Ethernet or MAC-level address. (The
  1864. term  MAC-level  address  is  more  general.   However for the sake of
  1865. concreteness, examples in this section will assume  that  Ethernet  is
  1866. being  used.    You  may generally replace the term "Ethernet address"
  1867. with the equivalent MAC-level address for other similar technologies.)
  1868. A bridge does not examine the packet itself, so it does not use the IP
  1869. address or its equivalent for  routing  decisions.    In  contrast,  a
  1870. gateway  bases  its decisions on the IP address, or its equivalent for
  1871. other protocols.
  1872.  
  1873. There are several reasons why it matters which kind of address is used
  1874. for  decisions.    The  most basic is that it affects the relationship
  1875. between the  switch  and  the  upper  layers  of  the  protocol.    If
  1876. forwarding is done at the level of the MAC-level address (bridge), the
  1877. switch will be invisible to the protocols.  If it is done  at  the  IP
  1878. level,  the  switch will be visible.  Let's give an example.  Here are
  1879.                                   30
  1880.  
  1881.  
  1882.  
  1883. two networks connected by a bridge:
  1884.  
  1885.               network 1          network 2
  1886.                128.6.5            128.6.4
  1887.         ==================  ================================
  1888.           |            |      |            |             |
  1889.        ___|______    __|______|__   _______|___   _______|___
  1890.        128.6.5.2        bridge       128.6.4.3     128.6.4.4
  1891.        __________    ____________   ___________   ___________
  1892.        computer A                   computer B    computer C
  1893.  
  1894.  
  1895. Note that the bridge does not have an IP address.  As far as computers
  1896. A,  B,  and  C  are  concerned,  there  is a single Ethernet (or other
  1897. network) to which they are all attached.  This means that the  routing
  1898. tables  must  be  set up so that computers on both networks treat both
  1899. networks as local.  When computer A opens a connection to computer  B,
  1900. it  first  broadcasts  an ARP request asking for computer B's Ethernet
  1901. address.  The bridge must  pass  this  broadcast  from  network  1  to
  1902. network  2.  (In general, bridges must pass all broadcasts.)  Once the
  1903. two computers know each other's Ethernet addresses, communications use
  1904. the  Ethernet  address  as the destination.  At that point, the bridge
  1905. can start exerting some selectivity.  It will only pass packets  whose
  1906. Ethernet  destination  address  is for a machine on the other network.
  1907. Thus a packet from B to A will be passed from network 2 to  1,  but  a
  1908. packet from B to C will be ignored.
  1909.  
  1910. In  order  to  make  this  selection,  the  bridge needs to know which
  1911. network each machine is on.  Most modern bridges build up a table  for
  1912. each  network,  listing the Ethernet addresses of machines known to be
  1913. on that network.  They do this by watching all of the packets on  both
  1914. networks.   When a packet first appears on network 1, it is reasonable
  1915. to conclude that the Ethernet source address corresponds to a  machine
  1916. on network 1.
  1917.  
  1918. Note  that a bridge must look at every packet on the Ethernet, for two
  1919. different reasons.  First, it may use  the  source  address  to  learn
  1920. which  machines  are  on  which  network.  Second, it must look at the
  1921. destination address in order to decide whether it needs to forward the
  1922. packet to the other network.
  1923.  
  1924. As  mentioned  above,  generally bridges must pass broadcasts from one
  1925. network to the other.  Broadcasts are often used to locate a resource.
  1926. The ARP request is a typical example of this.  Since the bridge has no
  1927. way of knowing what host is going to answer  the  broadcast,  it  must
  1928. pass   it   on  to  the  other  network.    Some  newer  bridges  have
  1929. user-selectable filters.  With them, it  is  possible  to  block  some
  1930. broadcasts  and  allow  others.  You might allow ARP broadcasts (which
  1931. are  essential  for  IP  to  function),  but  confine  less  essential
  1932. broadcasts  to one network.  For example, you might choose not to pass
  1933. rwhod broadcasts, which some systems use to keep track of  every  user
  1934. logged  into  every  other  system.    You  might  decide  that  it is
  1935. sufficient for rwhod to know about the systems on a single segment  of
  1936. the network.
  1937.  
  1938.                                   31
  1939.  
  1940.  
  1941.  
  1942. Now let's take a look at two networks connected by a gateway
  1943.  
  1944.               network 1                   network 2
  1945.                128.6.5                     128.6.4
  1946.         ====================      ==================================
  1947.           |              |          |              |             |
  1948.        ___|______    ____|__________|____   _______|___   _______|___
  1949.        128.6.5.2     128.6.5.1  128.6.4.1    128.6.4.3     128.6.4.4
  1950.        __________    ____________________   ___________   ___________
  1951.        computer A           gateway           computer B    computer C
  1952.  
  1953.  
  1954. Note  that  the  gateway  has IP addresses assigned to each interface.
  1955. The  computers'  routing  tables  are  set  up  to   forward   through
  1956. appropriate  address.    For  example,  computer A has a routing entry
  1957. saying that it should use the  gateway  128.6.5.1  to  get  to  subnet
  1958. 128.6.4.
  1959.  
  1960. Because  the  computers  know  about the gateway, the gateway does not
  1961. need to scan all the packets on the Ethernet.  The computers will send
  1962. packets to it when appropriate.  For example, suppose computer A needs
  1963. to send a message to computer B. Its routing table will tell it to use
  1964. gateway  128.6.5.1.    It  will issue an ARP request for that address.
  1965. The gateway will respond to the ARP request, just as any  host  would.
  1966. From then on, packets destinated for B will be sent with the gateway's
  1967. Ethernet address.
  1968.  
  1969.  
  1970.  
  1971. 5.2.3 More about bridges
  1972.  
  1973.  
  1974. There are several advantages to using  the  Mac-level  address,  as  a
  1975. bridge  does.   First, every packet on an Ethernet or IEEE network has
  1976. such an address.  The address is in the same place for  every  packet,
  1977. whether  it  is  IP,  DECnet,  or  some  other  protocol.   Thus it is
  1978. relatively fast to get the address from the packet.   A  gateway  must
  1979. decode  the  entire IP header, and if it is to support protocols other
  1980. than IP, it must have software for each such  protocol.    This  means
  1981. that  a bridge automatically supports every possible protocol, whereas
  1982. a gateway requires specific provisions for  each  protocol  it  is  to
  1983. support.
  1984.  
  1985. However  there  are  also disadvantages.  The one that is intrinsic to
  1986. the design of a bridge is
  1987.  
  1988.    - A bridge must look at every packet on the network, not just those
  1989.      addressed  to  it.    Thus it is possible to overload a bridge by
  1990.      putting it on a very busy network, even if very little traffic is
  1991.      actually going through the bridge.
  1992.  
  1993. However  there  are another set of disadvantages that are based on the
  1994. way bridges are usually built.  It is possible in principle to  design
  1995. bridges  that do not have these disadvantages, but I don't know of any
  1996. plans to do so.  They all stem from the fact that bridges do not  have
  1997.                                   32
  1998.  
  1999.  
  2000.  
  2001. a complete routing table that describes the entire system of networks.
  2002. They simply have a list of the Ethernet addresses that lie on each  of
  2003. its two networks. This means
  2004.  
  2005.    - A  bridge  can  handle only two network interfaces.  At a central
  2006.      site, where many networks converge, this normally means that  you
  2007.      set  up  a backbone network to which all the bridges connect, and
  2008.      then buy a separate bridge to connect each other network to  that
  2009.      backbone.  Gateways often have between 4 and 8 interfaces.
  2010.  
  2011.    - Networks  that  use  bridges cannot have loops in them.  If there
  2012.      were a loop,  some  bridges  would  see  traffic  from  the  same
  2013.      Ethernet address coming from both directions, and would be unable
  2014.      to decide which table to put that address  in.    Note  that  any
  2015.      parallel  paths  to  the  same direction constitute a loop.  This
  2016.      means  that  multiple  paths  cannot  be  used  for  purposes  of
  2017.      splitting the load or providing redundancy.
  2018.  
  2019. There  are  some  ways  of  getting around the problem of loops.  Many
  2020. bridges allow configurations with redundant connections, but turn  off
  2021. links  until  there are no loops left.  Should a link fail, one of the
  2022. disabled ones is then brought back into service.  Thus redundant links
  2023. can  still  buy  you  extra  reliability.    But they can't be used to
  2024. provide extra capacity.  It is also possible to build  a  bridge  that
  2025. will  make  use  of  parallel point to point lines, in the one special
  2026. case where those lines go between a  single  pair  of  bridges.    The
  2027. bridges  would  treat  the two lines as a single virtual line, and use
  2028. them alternately in round-robin fashion.
  2029.  
  2030. The process of disabling redundant  connections  until  there  are  no
  2031. loops  left  is  called  a "spanning tree algorithm".  This name comes
  2032. from the fact that a tree is defined as a pattern of connections  with
  2033. no loops.  Thus one wants to disable connections until the connections
  2034. that are left form a tree that "spans" (includes) all of the  networks
  2035. in  the  system.  In order to do this, all of the bridges in a network
  2036. system must communicate among themselves.  There is an  IEEE  proposal
  2037. to  standardize  the protocol for doing this, and for constructing the
  2038. spanning tree.
  2039.  
  2040. Note that there is a tendency  for  the  resulting  spanning  tree  to
  2041. result  in  high  network  loads  on certain parts of the system.  The
  2042. networks near the "top of the tree" handle all traffic between distant
  2043. parts  of  the  network.  In a network that uses gateways, it would be
  2044. possible to put in an extra link between parts  of  the  network  that
  2045. have  heavy  traffic between them.  However such extra links cannot be
  2046. used by a set of bridges.
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.                                   33
  2057.  
  2058.  
  2059.  
  2060. 5.2.4 More about gateways
  2061.  
  2062.  
  2063. Gateways have their own advantages and disadvantages.   In  general  a
  2064. gateway  is more complex to design and to administer than a bridge.  A
  2065. gateway must participate in all of the protocols that it  is  designed
  2066. to  forward.  For example, an IP gateway must respond to ARP requests.
  2067. The IP standards also require it to completely process the IP  header,
  2068. decrementing the time to live field and obeying any IP options.
  2069.  
  2070. Gateways  are  designed to handle more complex network topologies than
  2071. bridges.  As such, they have a different (and  more  complex)  set  of
  2072. decisions  to make.  In general a bridge has only a binary decision to
  2073. make: does it or does it not pass a given packet from one  network  to
  2074. the  other?    However  a gateway may have several network interfaces.
  2075. Furthermore, when it forwards a packet, it must decide  what  host  or
  2076. gateway to send the packet to next.  It is even possible for a gateway
  2077. to decide to send a packet back onto the same network  it  came  from.
  2078. If  a  host  is  using the gateway as its default, it may send packets
  2079. that really should go to some  other  gateway.    In  that  case,  the
  2080. gateway will send the packet on to the right gateway, and send back an
  2081. ICMP redirect to the host.  Many gateways  can  also  handle  parallel
  2082. paths.   If there are several equally good paths to a destination, the
  2083. gateway will alternate among them in round-robin fashion.
  2084.  
  2085. In order to handle these decisions, a gateway will  typically  have  a
  2086. routing  table  that  looks  very  much  like  a host's.  As with host
  2087. routing tables, a gateway's table contains an entry for each  possible
  2088. network  number.    For  each network, there is either an entry saying
  2089. that that network is connected directly to the gateway, or there is an
  2090. entry saying that traffic for that network should be forwarded through
  2091. some other gateway  or  gateways.    We  will  describe  the  "routing
  2092. protocols"  used to build up this information later, in the discussion
  2093. on how to configure a gateway.
  2094.  
  2095.  
  2096.  
  2097. 5.3 Comparing the switching technologies
  2098.  
  2099.  
  2100. Repeaters, buffered repeaters, bridges, and gateways form a  spectrum.
  2101. Those  devices  near  the  beginning  of the list are best for smaller
  2102. networks.  They are less expensive, and easier to  set  up,  but  less
  2103. general.    Those  near  the end of the list are suitable for building
  2104. more complex networks.  Many networks will contain a mixture of switch
  2105. types,  with  repeaters  being  used  to  connect a few nearby network
  2106. segments, bridges used for slightly larger areas  (particularly  those
  2107. with low traffic levels), and gateways used for long-distance links.
  2108.  
  2109. Note  that  this  document  so  far has assumed that only gateways are
  2110. being used.  The section on setting up a host described how to set  up
  2111. a  routing  table  listing  the  gateways  to  use  to  get to various
  2112. networks.  Repeaters and bridges are invisible to IP.  So  as  far  as
  2113. previous  sections are concerned, networks connected by them are to be
  2114. considered a single network.  Section 3.3.1 describes how to configure
  2115.                                   34
  2116.  
  2117.  
  2118.  
  2119. a  host  in  the  case  where  several subnets are carried on a single
  2120. physical network.  The same configuration should be used when  several
  2121. subnets are connected by repeaters or bridges.
  2122.  
  2123. As  mentioned  above,  the most important dimensions on which switches
  2124. vary are isolation,  performance,  routing,  network  management,  and
  2125. performing auxilliary support services.
  2126.  
  2127.  
  2128.  
  2129. 5.3.1 Isolation
  2130.  
  2131.  
  2132. Generally  people  use switches to connect networks to each other.  So
  2133. they are normally thinking  of  gaining  connectivity,  not  providing
  2134. isolation.  However isolation is worth thinking about.  If you connect
  2135. two networks and  provide  no  isolation  at  all,  then  any  network
  2136. problems  on  other  networks suddenly appear on yours as well.  Also,
  2137. the two networks together may have enough traffic  to  overwhelm  your
  2138. network.  Thus it is well to think of choosing an appropriate level of
  2139. protection.
  2140.  
  2141. Isolation comes in  two  kinds:  isolation  against  malfunctions  and
  2142. traffic  isolation.  In order to discuss isolation of malfunctions, we
  2143. have to have a taxonomy of malfunctions.  Here are the  major  classes
  2144. of malfunctions, and which switches can isolate them:
  2145.  
  2146.    - Electrical  faults,  e.g.    a short in the cable or some sort of
  2147.      fault that distorts the signal.  All types of switch will confine
  2148.      this  to  one  side  of  the switch: repeater, buffered repeater,
  2149.      bridge, gateway.  These are worth  protecting  against,  although
  2150.      their frequency depends upon how often your cables are changed or
  2151.      disturbed.  It is rare for this sort of fault  to  occur  without
  2152.      some disturbance of the cable.
  2153.  
  2154.    - Transceiver and controller problems that general signals that are
  2155.      valid electrically but nevertheless incorrect (e.g. a continuous,
  2156.      infinitely  long  packet,  spurious  collisions,  never  dropping
  2157.      carrier).  All except the  simple  repeater  will  confine  this:
  2158.      buffered  repeater, bridge, gateway.  (Such problems are not very
  2159.      common.)
  2160.  
  2161.    - Software malfunctions that  lead  to  excessive  traffic  between
  2162.      particular  hosts  (i.e.  not  broadcasts).  Bridges and gateways
  2163.      will isolate these.  (This type of failure is fairly rare.   Most
  2164.      software and protocol problems generate broadcasts.)
  2165.  
  2166.    - Software  malfunctions  that lead to excessive broadcast traffic.
  2167.      Gateways will isolate these.  Generally bridges will not, because
  2168.      they  must pass broadcasts.  Bridges with user-settable filtering
  2169.      can protect against some  broadcast  malfunctions.    However  in
  2170.      general  bridges  must  pass ARP, and most broadcast malfunctions
  2171.      involve ARP.    This  problem  is  not  severe  on  single-vendor
  2172.      networks  where  software  is  under  careful  control.   However
  2173.      research sites generally see problems of this sort regularly.
  2174.                                   35
  2175.  
  2176.  
  2177.  
  2178. Traffic isolation is provided by bridges and gateways.  The most basic
  2179. decision  is  how  many  computers  can  be put onto a network without
  2180. overloading its capacity.  This requires knowledge of the capacity  of
  2181. the  network,  but  also  how  the hosts will use it.  For example, an
  2182. Ethernet may support hundreds of systems if all the  network  is  used
  2183. for  is remote logins and an occasional file transfer.  However if the
  2184. computers are diskless, and use the network for swapping, an  Ethernet
  2185. will  support  between  10 and 40, depending upon their speeds and I/O
  2186. rates.
  2187.  
  2188. When you have to put more computers onto a network than it can handle,
  2189. you split it into several networks and put some sort of switch between
  2190. them.  If you do the split correctly, most  of  the  traffic  will  be
  2191. between machines on the same piece.  This means putting clients on the
  2192. same network as their servers, putting terminal servers  on  the  same
  2193. network as the hosts that they access most commonly, etc.
  2194.  
  2195. Bridges  and  gateways  generally  provide  similar degrees of traffic
  2196. isolation.  In both cases, only traffic bound for hosts on  the  other
  2197. side of the switch is passed.  However see the discussion on routing.
  2198.  
  2199.  
  2200.  
  2201. 5.3.2 Performance
  2202.  
  2203.  
  2204. This  is  becoming  less  of  an  issue  as  time  goes  on, since the
  2205. technology is improving.  Generally  repeaters  can  handle  the  full
  2206. bandwidth  of  the  network.  (By their very nature, a simple repeater
  2207. must be able to do so.) Bridges and gateways  often  have  performance
  2208. limitations  of  various sorts.  Bridges have two numbers of interest:
  2209. packet scanning rate and throughput.  As  explained  above,  a  bridge
  2210. must  look  at every packet on the network, even ones that it does not
  2211. forward.  The number of packets per second that it can  scan  in  this
  2212. way  is  the packet scanning rate.  Throughput applies to both bridges
  2213. and gateways.  This is the rate at which  they  can  forward  traffic.
  2214. Generally  this  depends  upon  packet  size.   Normally the number of
  2215. packets per second that a unit can handle will be  greater  for  short
  2216. packets  than  long  ones.    Early models of bridge varied from a few
  2217. hundred packets per second to around 7000.  The higher speeds are  for
  2218. equipment  that  uses special-purpose hardware to speed up the process
  2219. of scanning packets.  First-generation  gateways  varied  from  a  few
  2220. hundred packets per second to 1000 or more.  However second-generation
  2221. gateways are now available, using special-purpose hardware of the same
  2222. sophistication  as that used by bridges.  They can handle on the order
  2223. of 10000 packets per second.   Thus  at  the  moment  high-performance
  2224. bridges  and gateways can switch most of the bandwidth of an Ethernet.
  2225. This means that performance should no longer be a basis  for  choosing
  2226. between types of switch.  However within a given type of switch, there
  2227. are still specific models with higher or lower capacity.
  2228.  
  2229. Unfortunately there  is  no  single  number  on  which  you  can  base
  2230. performance estimates.  The figure most commonly quoted is packets per
  2231. second.  Be aware that most vendors count a packet  only  once  as  it
  2232. goes  through  a gateway, but that one prominent vendor counts packets
  2233.                                   36
  2234.  
  2235.  
  2236.  
  2237. twice.  Thus their switching rates must be deflated by a factor of  2.
  2238. Also,  when  comparing  numbers make sure that they are for packets of
  2239. the same size.  A simple performance model is
  2240.  
  2241.     processing time = switching time + packet size * time per byte
  2242.  
  2243. That is, the time to switch a packet is normally a constant  switching
  2244. time, representing interrupt latency, header processing, routing table
  2245. lookup,  etc.,  plus  a  component  proportional   to   packet   size,
  2246. representing the time needed to do any packet copying.  One reasonable
  2247. approach to reporting performance is to give packets  per  second  for
  2248. minimum  and  maximum  size  packets.    Another is to report limiting
  2249. switching speed in packets per second  and  throughput  in  bytes  per
  2250. second, i.e.  the two terms of the equation above.
  2251.  
  2252.  
  2253.  
  2254. 5.3.3 Routing
  2255.  
  2256.  
  2257. Routing refers to the technology used to decide where to send a packet
  2258. next.  Of course for a repeater this is not an issue, since  repeaters
  2259. forward every packet.
  2260.  
  2261. Bridges  are  almost  always  constructed with exactly two interfaces.
  2262. Thus routing turns into two decisions: (1) whether the  bridge  should
  2263. function  at  all,  and  (2)  whether it should forward any particular
  2264. packet.  The second decision is usually based on a table of  MAC-level
  2265. addresses.    As described above, this is built up by scanning traffic
  2266. on both sides of the bridge.  The goal is  to  forward  those  packets
  2267. whose  destination is on the other side of the bridge.  This algorithm
  2268. requires that the network configuration have  no  loops  or  redundant
  2269. lines.    Less  sophisticated  bridges  leave  this  up  to the system
  2270. designer.  With these bridges, you must set up your  network  so  that
  2271. there  are no loops in it.  More sophisticated bridges allow arbitrary
  2272. topology, but disable links until no  loops  remain.    This  provides
  2273. extra  reliability.    If  a  link  fails, an alternative link will be
  2274. turned on automatically.  Bridges that work  this  way  have  protocol
  2275. that  allows them to detect when a unit must be disabled or reenabled,
  2276. so that at any instant the set  of  active  links  forms  a  "spanning
  2277. tree".   If you require the extra reliability of redundant links, make
  2278. sure that the bridges you use can disable  and  enable  themselves  in
  2279. this  way.    There is currently no official standard for the protocol
  2280. used among bridges, although there  is  a  standard  in  the  proposal
  2281. stage.    If you buy bridges from more than one vendor, make sure that
  2282. their spanning-tree protocols will interoperate.
  2283.  
  2284. Gateways generally allow arbitrary network topologies, including loops
  2285. and  redundant  links.    Because  gateways  may  have  more  than two
  2286. interfaces, they must decide not only when to forward  a  packet,  but
  2287. where  to  send  it  next.  They do this by maintaining a model of the
  2288. entire network topology.  Different routing techniques maintain models
  2289. of greater or lesser complexity, and use the data with varying degrees
  2290. of sophistication.   Gateways  that  handle  TCP/IP  should  generally
  2291. support  the  two  Internet  standard  routing protocols: RIP (Routing
  2292.                                   37
  2293.  
  2294.  
  2295.  
  2296. Information Protocol) and EGP (External Gateway Protocol).  EGP  is  a
  2297. special-purpose protocol for use in networks where there is a backbone
  2298. under a separate administration.  It allows exchange  of  reachability
  2299. information  with  the  backbone  in  a  controlled way.  If you are a
  2300. member of such a network, your gateway must  support  EGP.    This  is
  2301. becoming  common  enough  that it is probably a good idea to make sure
  2302. that all gateways support EGP.
  2303.  
  2304. RIP is a protocol designed to handle routing within small to  moderate
  2305. size networks, where line speeds do not differ radically.  Its primary
  2306. limitations are:
  2307.  
  2308.    - It cannot be used with networks where any path goes through  more
  2309.      than  15  gateways.  This range may be further reduced if you use
  2310.      an optional feature for giving a slow line a weight  larger  than
  2311.      one.
  2312.  
  2313.    - It  cannot  share  traffic  between parallel lines (although some
  2314.      implementations allow this if the lines are between the same pair
  2315.      of gateways).
  2316.  
  2317.    - It cannot adapt to changes in network load.
  2318.  
  2319.    - It  is  not well suited to situations where there are alternative
  2320.      routes through lines of very different speeds.
  2321.  
  2322.    - It may not be stable in networks where lines or gateways change a
  2323.      lot.
  2324.  
  2325. Some  vendors supply proprietary modifications to RIP that improve its
  2326. operation with EGP or increase the maximum path length beyond 15,  but
  2327. do  not  otherwise modify it very much.  If you expect your network to
  2328. involve gateways from more  than  one  vendor,  you  should  generally
  2329. require  that  all of them support RIP, since this is the only routing
  2330. protocol that is generally available.  If you expect  to  use  a  more
  2331. sophisticated  protocol  in  addition,  the  gateways  must  have some
  2332. ability to translate between their own protocol and RIP.  However  for
  2333. very large or complex networks, there may be no choice but to use some
  2334. other protocol throughout.
  2335.  
  2336. More sophisticated routing protocols are possible.  The  primary  ones
  2337. being considered today are cisco System's IGRP, and protocols based on
  2338. the SPF (shortest-path first) algorithms.  In general these  protocols
  2339. are designed for larger or more complex networks.  They are in general
  2340. stable under a wider  variety  of  conditions,  and  they  can  handle
  2341. arbitrary combinations of line type and speed.  Some of them allow you
  2342. to  split  traffic  among  parallel  paths,  to  get  better   overall
  2343. throughput.    Some newer technologies may allow the network to adjust
  2344. to take into account paths that are overloaded.  However at the moment
  2345. I  do  not  know of any commercial gateway that does this.  (There are
  2346. very serious problems with maintaining stable  routing  when  this  is
  2347. done.) There are enough variations among routing technology, and it is
  2348. changing rapidly enough, that you should discuss your proposed network
  2349. topology  in  detail with all of the vendors that you are considering.
  2350. Make sure that their technology can  handle  your  topology,  and  can
  2351.                                   38
  2352.  
  2353.  
  2354.  
  2355. support  any  special  requirements  that you have for sharing traffic
  2356. among parallel lines, and for adjusting topology to take into  account
  2357. failures.    In  the  long  run,  we expect one or more of these newer
  2358. routing protocols to attain the status of a standard, at least on a de
  2359. facto basis.  However at the moment, there is no generally implemented
  2360. routing technology other than RIP.
  2361.  
  2362. One additional routing topic to consider is policy-based routing.   In
  2363. general routing protocols are designed to find the shortest or fastest
  2364. possible path for every packet.  In some cases, this is  not  desired.
  2365. For  reasons  of  security, cost accountability, etc., you may wish to
  2366. limit certain paths to certain uses.   Most  gateways  now  have  some
  2367. ability to control the spread of routing information so as to give you
  2368. some administrative control over the way routes are used.    Different
  2369. gateways  vary  in the degree of control that they support.  Make sure
  2370. that you discuss any requirements that you have for control  with  all
  2371. prospective gateway vendors.
  2372.  
  2373.  
  2374.  
  2375. 5.3.4 Network management
  2376.  
  2377.  
  2378. Network  management  covers  a  wide variety of topics.  In general it
  2379. includes gathering statistical data and status information about parts
  2380. of  your network, and taking action as necessary to deal with failures
  2381. and other changes.  There are several things that a switch can  do  to
  2382. make this process easier.  The most basic is that it should have a way
  2383. of gathering and reporting statistics.  These should  include  various
  2384. sorts  of packet counts, as well as counts of errors of various kinds.
  2385. This data is likely to be  most  detailed  in  a  gateway,  since  the
  2386. gateway  classifies  packets using the protocols, and may even respond
  2387. to certain types of packet itself.  However bridges and even  buffered
  2388. repeaters  can  certainly  have counts of packets forwarded, interface
  2389. errors, etc.  It should be  possible  to  collect  this  data  from  a
  2390. central monitoring point.
  2391.  
  2392. There is now an official Internet approach to network monitoring.  The
  2393. first stages use a related set of protocols, SGMP and SNMP.   Both  of
  2394. these  protocols  are designed to allow you to collect information and
  2395. to make changes in configuration parameters  for  gateways  and  other
  2396. entities on your network.  You can run the matching interface programs
  2397. on any host in your network.    SGMP  is  now  available  for  several
  2398. commercial  gateways,  as  well as for Unix systems that are acting as
  2399. gateways.  There is a  limited  set  of  information  which  any  SGMP
  2400. implementation  is  required to supply, as well as a uniform mechanism
  2401. for vendors to add information of their own.  By late 1988, the second
  2402. generation  of  this  protocol, SNMP, should be in service.  This is a
  2403. slightly more sophisticated protocol.  It has with it a more  complete
  2404. set  of  information that can be monitored, called the MIB (Management
  2405. Information Base).  Unlike the somewhat  ad  hoc  collection  of  SGMP
  2406. variables,  the  MIB is the result of numerous committee deliberations
  2407. involving a number of vendors and users.  Eventually  it  is  expected
  2408. that  there  will  be  a  TCP/IP  equivalent  of CMIS, the ISO network
  2409. monitoring service.  However CMIS, and its protocols,  CMIP,  are  not
  2410.                                   39
  2411.  
  2412.  
  2413.  
  2414. yet  official  ISO  standards,  so  they are still in the experimental
  2415. stages.
  2416.  
  2417. In general terms all of these protocols  accomplish  the  same  thing:
  2418. They  allow you to collect criticial information in a uniform way from
  2419. all vendors' equipment.  You send commands as  UDP  datagrams  from  a
  2420. network  management  program  running  on  some  host in your network.
  2421. Generally the interaction is fairly simple,  with  a  single  pair  of
  2422. datagrams exchanged: a command and a response.  At the moment security
  2423. is fairly simple.  It  is  possible  to  require  what  amounts  to  a
  2424. password  in  the  command.   (In SGMP it is referred to as a "session
  2425. name", rather  than  a  password.)  More  elaborate,  encryption-based
  2426. security is being developed.
  2427.  
  2428. You  will  probably  want to configure the network management tools at
  2429. your disposal to do several different things.  For short-term  network
  2430. monitoring,  you will want to keep track of switches crashing or being
  2431. taken down for maintenance, and of failure of communications lines and
  2432. other  hardware.  It is possible to configurate SGMP and SNMP to issue
  2433. "traps" (unsolited messages) to a specified host or list of hosts when
  2434. some of these critical events occur (e.g. lines up and down).  However
  2435. it is unrealistic to expect a switch to notify you  when  it  crashes.
  2436. It  is  also  possible  for  trap  messages  to be lost due to network
  2437. failure or  overload.    Thus  you  should  also  poll  your  switches
  2438. regularly  to  gather  information.    Various displays are available,
  2439. including a map of your network where  items  change  color  as  their
  2440. status  changes, and running "strip charts" that show packet rates and
  2441. other items through selected switches.  This software is still in  its
  2442. early  stages,  so  you  should  expect  to  see a lot of change here.
  2443. However at the very least you should expect to be notified in some way
  2444. of  failures.    You  may  also  want  to  be  able to take actions to
  2445. reconfigure the system in  response  to  failures,  although  security
  2446. issues make some mangers nervous about doing that through the existing
  2447. management protocols.
  2448.  
  2449. The second type of monitoring you are likely  to  want  to  do  is  to
  2450. collect information for use in periodic reports on network utilization
  2451. and  performance.    For  this,  you  need  to  sample   each   switch
  2452. perodically,  and  retrieve numbers of interest.  At Rutgers we sample
  2453. hourly, and get the number of packets forwarded for IP and  DECnet,  a
  2454. count  of reloads, and various error counts.  These are reported daily
  2455. in some detail.  Monthly summaries are produced giving traffic through
  2456. each  gateway,  and a few key error rates chosen to indicate a gateway
  2457. that is being overloaded (packets dropped in input and output).
  2458.  
  2459. It should be possible to use monitoring techniques of this  kind  with
  2460. most  types  of switch.  At the moment, simple repeaters do not report
  2461. any statistics.  Since they do not generally have processors in  them,
  2462. doing  so  would  cause  a  major  increase in their cost.  However it
  2463. should be possible to do network management  for  buffered  repeaters,
  2464. bridges,  and  gateways.    Gateways  are  the  most likely to contain
  2465. sophisticated network management software.  Most gateway vendors  that
  2466. handle  TCP/IP  are  expected  to  implement  the monitoring protocols
  2467. described above.    Many  bridge  vendors  make  some  provisions  for
  2468. collecting performance data.  Since bridges are not protocol-specific,
  2469.                                   40
  2470.  
  2471.  
  2472.  
  2473. most  of  them  do  not  have  the  software  necessary  to  implement
  2474. TCP/IP-based  network management protocols.  In some cases, monitoring
  2475. can be done only by typing commands to  a  directly-attached  console.
  2476. (We have seen one case where it is necessary to take the bridge out of
  2477. service to gather this data.) In other cases, it is possible to gather
  2478. data  via  the  network, but the monitoring protocol is ad hoc or even
  2479. proprietary.
  2480.  
  2481. Except for very small networks, you should probably insist that all of
  2482. the devices on your network collect statistics and provide some way of
  2483. querying them remotely.  In the long run,  you  can  expect  the  most
  2484. software  to be available for standard protocols such as SGMP/SNMP and
  2485. CMIS.  However proprietary monitoring tools may be sufficient as  long
  2486. as they work with all of the equipment that you have.
  2487.  
  2488.  
  2489.  
  2490. 5.3.5 A final evaluation
  2491.  
  2492.  
  2493. Here  is  a summary of the places where each kind of switch technology
  2494. is normally used:
  2495.  
  2496.    - Repeaters are normally confined to a single building.  Since they
  2497.      provide  no traffic isolation, you must make sure that the entire
  2498.      set of networks connected by repeaters can carry the traffic from
  2499.      all  of  the  computers  on  it.  Since they generally provide no
  2500.      network monitoring tools, you will not want to use repeaters  for
  2501.      a link that is likely to fail.
  2502.  
  2503.    - Bridges  and gateways should be placed sufficiently frequently to
  2504.      break your network into pieces for which the  traffic  volume  is
  2505.      manageable.   You may want to place bridges or gateways in places
  2506.      where traffic would  not  require  them  for  network  monitoring
  2507.      reasons.
  2508.  
  2509.    - Because  bridges must pass broadcast packets, there is a limit to
  2510.      the size network you can construct using them.  It is probably  a
  2511.      good  idea to limit the network connected by bridges to a hundred
  2512.      systems or so.  This number can be increased somewhat for bridges
  2513.      with good facilities for filtering.
  2514.  
  2515.    - Because  certain  kinds  of  network  misbehavior will be passed,
  2516.      bridges should be used only among portions of the network where a
  2517.      single group is responsible for diagnosing problems.  You have to
  2518.      be crazy to use a bridge  between  networks  owned  by  different
  2519.      organizations.    Portions  of your network where experiments are
  2520.      being done in network technology should always be  isolated  from
  2521.      the rest of the network by gateways.
  2522.  
  2523.    - For  many  applications  it is more important to choose a product
  2524.      with the right combination  of  performance,  network  management
  2525.      tools,  and  other  features  than  to  make the decision between
  2526.      bridges and gateways.
  2527.  
  2528.                                   41
  2529.  
  2530.  
  2531.  
  2532. @section(Configuring Gateways)
  2533.  
  2534. This section deals with configuration  issues  that  are  specific  to
  2535. gateways.   Gateways than handle TCP/IP are themselves Internet hosts.
  2536. Thus the  discussions  above  on  configuring  addresses  and  routing
  2537. information  apply to gateways as well as to hosts.  The exact way you
  2538. configure a gateway will depend upon the vendor.  In some  cases,  you
  2539. edit  files  stored  on  a  disk  in  the gateway itself.  However for
  2540. reliability reasons most gateways do not have disks of their own.  For
  2541. them, configuration information is stored in non-volatile memory or in
  2542. configuration files that are uploaded from one or more  hosts  on  the
  2543. network.
  2544.  
  2545. At  a  minimum, configuration involves specifying the Internet address
  2546. and address mask for  each  interface,  and  enabling  an  appropriate
  2547. routing   protocol.    However  generally  a  few  other  options  are
  2548. desirable.  There are often parameters in  addition  to  the  Internet
  2549. address that you should set for each interface.
  2550.  
  2551. One important parameter is the broadcast address.  As explained above,
  2552. older software may react badly when broadcasts are sent using the  new
  2553. standard  broadcast  address.  For this reason, some vendors allow you
  2554. to choose a broadcast address to be used on each interface.  It should
  2555. be  set  using  your  knowledge  of  what computers are on each of the
  2556. networks.  In general if the computers  follow  current  standards,  a
  2557. broadcast  address  of  255.255.255.255 should be used.  However older
  2558. implementations may behave better with other  addresses,  particularly
  2559. the  address  that  uses  zeros for the host number.  (For the network
  2560. 128.6 this would be 128.6.0.0.  For compatibility with  software  that
  2561. does  not  implement subnets, you would use 128.6.0.0 as the broadcast
  2562. address even for a subnet such as  128.6.4.)  You  should  watch  your
  2563. network  with  a  network  monitor  and  see  the  results  of several
  2564. different broadcast address choices.  If you make a bad choice,  every
  2565. time  the  gateway  sends a routing update broadcast, many machines on
  2566. your network will respond with ARP's or ICMP errors.  Note  that  when
  2567. you  change  the  broadcast  address  in  the gateway, you may need to
  2568. change it on the individual computers as well.  Generally the idea  is
  2569. to  change  the  address on the systems that you can configure to give
  2570. behavior that is compatible with systems that you can't configure.
  2571.  
  2572. Other interface parameters may be necessary to deal with peculiarities
  2573. of  the  network  it is connected to.  For example, many gateways test
  2574. Ethernet interfaces to make sure that the cable is connected  and  the
  2575. transceiver  is  working correctly.  Some of these tests will not work
  2576. properly with the older Ethernet version 1 transceivers.  If  you  are
  2577. using  such  a  transceiver,  you would have to disable this keepalive
  2578. testing.  Similarly, gateways connected by a serial line  normally  do
  2579. regular  testing  to  make sure that the line is still working.  There
  2580. can be situations where this needs to be disabled.
  2581.  
  2582. Often you will have to enable features of the software that  you  want
  2583. to  use.    For  example, it is often necessary to turn on the network
  2584. management protocol explicitly, and to give it the name or address  of
  2585. a host that is running software to accept traps (error messages).
  2586.  
  2587.                                   42
  2588.  
  2589.  
  2590.  
  2591. Most  gateways  have  options  that relate to security.  At a minimum,
  2592. this may include setting password for making changes remotely (and the
  2593. "session  name"  for  SGMP).  If you need to control access to certain
  2594. parts of your network, you will also need  to  define  access  control
  2595. lists or whatever other mechanism your gateway uses.
  2596.  
  2597. Gateways  that load configuration information over the network present
  2598. special issues.   When  such  a  gateway  boots,  it  sends  broadcast
  2599. requests of various kinds, attempting to find its Internet address and
  2600. then to load configuration information.  Thus it is necessary to  make
  2601. sure  that there is some computer that is prepared to respond to these
  2602. requests.  In some cases, this is a dedicated  micro  running  special
  2603. software.   In other cases, generic software is available that can run
  2604. on a variety of machines.  You should consult your vendor to make sure
  2605. that  this  can be arranged.  For reliability reasons, you should make
  2606. sure that there is  more  than  one  host  with  the  information  and
  2607. programs  that  your  gateways  need.   In some cases you will have to
  2608. maintain several different files.  For example, the gateways  used  at
  2609. Rutgers use a program called "bootp" to supply their Internet address,
  2610. and they then load the code and configuration information using  TFTP.
  2611. This  means  that  we  have to maintain a file for bootp that contains
  2612. Ethernet and Internet addresses for each gateway, and a set  of  files
  2613. containing  other configuration information for each gateway.  If your
  2614. network is large, it is worth taking some trouble to  make  sure  that
  2615. this  information remains consistent.  We keep master copies of all of
  2616. the configuration information on a single computer, and distribute  it
  2617. to  other  systems  when it changes, using the Unix utilities make and
  2618. rdist.    If  your  gateway  has  an  option  to  store  configuration
  2619. information  in  non-volatile memory, you will eliminate some of these
  2620. logistical headaches.  However this presents its own  problems.    The
  2621. contents  of  non-volatile  memory should be backed up in some central
  2622. location.  It will also be harder for network management personnel  to
  2623. review  configuration  information  if  it  is  distributed  among the
  2624. gateways.
  2625.  
  2626. Starting  a  gateway  is  particularly   challenging   if   it   loads
  2627. configuration  information  from  a  distant  portion  of the network.
  2628. Gateways that  expect  to  take  configuration  information  from  the
  2629. network  generally  issue broadcast requests on all of the networks to
  2630. which they are connected.  If there is a  computer  on  one  of  those
  2631. networks  that  is  prepared  to  respond  to  the request, things are
  2632. straightforward.  However some gateways may  be  in  remote  locations
  2633. where  there  are  no  nearby  computer  systems  that can support the
  2634. necessary protocols.  In this case, it is necessary to arrange for the
  2635. requests  to  be  routed  back  to network where there are appropriate
  2636. computers.  This requires what is strictly speaking a violation of the
  2637. basic  design philosophy for gateways.  Generally a gateway should not
  2638. allow broadcasts from one network  to  pass  through  to  an  adjacent
  2639. network.    In  order  to  allow  a  gateway to get information from a
  2640. computer on a different network, at  least  one  of  the  gateways  in
  2641. between  will  have  to  be configured to pass the particular class of
  2642. broadcasts used to retrieve this information.  If you have  this  sort
  2643. of  configuration,  you should test the loading process regularly.  It
  2644. is not unusual to find that gateways do not  come  up  after  a  power
  2645. failure  because  someone changed the configuration of another gateway
  2646.                                   43
  2647.  
  2648.  
  2649.  
  2650. and made it impossible to load some necessary information.
  2651.  
  2652.  
  2653.  
  2654. 5.4 Configuring routing for gateways
  2655.  
  2656.  
  2657. The final topic to be considered is configuring routing.  This is more
  2658. complex  for  a gateway than for a normal host.  Most Internet experts
  2659. recommend that routing be left to the gateways.  Thus hosts may simply
  2660. have  a  default  route that points to the nearest gateway.  Of course
  2661. the gateways themselves can't get by with this.   They  need  to  have
  2662. complete routing tables.
  2663.  
  2664. In  order to understand how to configure a gateway, we have to look in
  2665. a bit more detail at how gateways communicate routes.  When you  first
  2666. turn  on a gateway, the only networks it knows about are the ones that
  2667. are  directly  connected  to  it.    (They  are   specified   by   the
  2668. configuration  information.)   In order to find out how to get to more
  2669. distant parts of the network, it engages  in  some  sort  of  "routing
  2670. protocol".    A routing protocol is simply a protocol that allows each
  2671. gateway to advertise which networks it can get to, and to spread  that
  2672. information  from  one  gateway to the next.  Eventually every gateway
  2673. should know how to get to every network.  There are  different  styles
  2674. of routing protocol.  In one common type, gateways talk only to nearby
  2675. gateways.  In  another  type,  every  gateway  builds  up  a  database
  2676. describing  every  other  gateway  in  the system.  However all of the
  2677. protocols have some way for each gateway in the system to find out how
  2678. to get to every destination.
  2679.  
  2680. A  metric is some number or set of numbers that can be used to compare
  2681. routes.  The routing table is  constructed  by  gathering  information
  2682. from other gateways.  If two other gateways claim to be able to get to
  2683. the same destination, there must be some way of deciding which one  to
  2684. use.   The metric is used to make that decision.  Metrics all indicate
  2685. in some general sense the "cost" of a route.  This may be  a  cost  in
  2686. dollars of sending packets over that route, the delay in milliseconds,
  2687. or some other measure.  The simplest metric is just  a  count  of  the
  2688. number  of  gateways  along  the  path.  This is referred to as a "hop
  2689. count".  Generally this metric  information  is  set  in  the  gateway
  2690. configuration files, or is derived from information appearing there.
  2691.  
  2692. At  a minimum, routing configuration is likely to consist of a command
  2693. to enable the routing protocol that you want to  use.    Most  vendors
  2694. will have a prefered routing protocol.  Unless you have some reason to
  2695. choose another, you should use that.  The normal reason  for  choosing
  2696. another  protocol  is  for  compatibility with other kinds of gateway.
  2697. For example, your network may be  connected  to  a  national  backbone
  2698. network  that  requires  you to use EGP (exterior gateway protocol) to
  2699. communicate routes with it.  EGP is only appropriate for that specific
  2700. case.    You  should  not use EGP within your own network, but you may
  2701. need to use it  in  addition  to  your  regular  routing  protocol  to
  2702. communicate  with a national network.  If your own network has several
  2703. different types of gateway, then  you  may  need  to  pick  a  routing
  2704. protocol  that  all of them support.  At the moment, this is likely to
  2705.                                   44
  2706.  
  2707.  
  2708.  
  2709. be RIP (Routing Information Protocol).  Depending upon the  complexity
  2710. of  your  network,  you  could  use  RIP  throughout it, or use a more
  2711. sophisticated protocol among the gateways that support it, and use RIP
  2712. only at the boundary between gateways from different vendors.
  2713.  
  2714. Assuming  that  you  have  chosen a routing protocol and turned it on,
  2715. there are some additional decisions that you may need to make.  One of
  2716. the  more  basic configuration options has to do with supplying metric
  2717. information.  As indicated above, metrics are numbers which  are  used
  2718. to decide which route is the best.  Unsophisticated routing protocols,
  2719. e.g. RIP, normally just count hops.  So a route that passes through  2
  2720. gateways  would  be  considered better than one that passes through 3.
  2721. Of course if the latter route used 1.5Mbps lines and the  former  9600
  2722. bps  lines,  this  would  be  the  wrong  decision.  Thus most routing
  2723. protocols allow you to set parameters to take this sort of thing  into
  2724. account.  With RIP, you would arrange to treat the 9600 bps line as if
  2725. it were several hops.  You would  increase  the  effective  hop  count
  2726. until  the  better route was chosen.  More sophisticated protocols may
  2727. take the bit rate of the line into account automatically.  However you
  2728. should  be on the lookout for configuration parameters that need to be
  2729. set.    Generally  these  parameters  will  be  associated  with   the
  2730. particular  interface.   For example, with RIP you would have to set a
  2731. metric value for the interface connected to the 9600 bps line.    With
  2732. protocols  that  are  based on bit rate, you might need to specify the
  2733. speed  of  each  line  (if  the   gateway   cannot   figure   it   out
  2734. automatically).
  2735.  
  2736. Most  routing  protocols  are  designed  to let each gateway learn the
  2737. topology of the entire network, and to choose the best possible  route
  2738. for  each  packet.    In some cases you may not want to use the "best"
  2739. route.  You may want traffic to stay out of a certain portion  of  the
  2740. network  for  security  or  cost  reasons.   One way to institute such
  2741. controls is by specifying routing options.  These options  are  likely
  2742. to be different for different vendors.  But the basic strategy is that
  2743. if the rest of the network doesn't know about a  route,  it  won't  be
  2744. used.    So  controls normally take the form of limiting the spread of
  2745. information about routes whose use you want to control.
  2746.  
  2747. Note that there  are  ways  for  the  user  to  override  the  routing
  2748. decisions made by your gateways.  If you really need to control access
  2749. to a certain network, you will have to do two separate  things:    Use
  2750. routing  controls  to  make sure that the gateways use only the routes
  2751. you want them to.  But also use access control lists on  the  gateways
  2752. that are adjacent to the sensitive networks.  These two mechanisms act
  2753. at different levels.  The routing controls affect what happens to most
  2754. packets:  those  where  the  user  has not specified routing manually.
  2755. Your routing mechanism must be set up to choose  an  acceptable  route
  2756. for  them.   The access control list provides an additional limitation
  2757. which prevents users from supplying their own  routing  and  bypassing
  2758. your controls.
  2759.  
  2760. For  reliability  and  security reasons, there may also be controls to
  2761. allow you to list the gateways from which you will accept information.
  2762. It  may  also  be possible to rank gateways by priority.  For example,
  2763. you might decide to listen to routes from within your own organization
  2764.                                   45
  2765.  
  2766.  
  2767.  
  2768. before   routes  from  other  organizations  or  other  parts  of  the
  2769. organization.  This would  have  the  effect  of  having  traffic  use
  2770. internal  routes  in preference to external ones, even if the external
  2771. ones appear to be better.
  2772.  
  2773. If you use several different routing protocols, you will probably have
  2774. some  decisions  to  make regarding how much information to pass among
  2775. them.  Since multiple routing  protocols  are  often  associated  with
  2776. multiple  organizations,  you  must be sure to make these decisions in
  2777. consultation  with  management  of  all  of  the  relevant   networks.
  2778. Decisions  that  you  make may have consequences for the other network
  2779. which are not immediately obvious.  You might think it would  be  best
  2780. to  configure  the gateway so that everything it knows is passed on by
  2781. all routing protocols.  However here are some reasons why you may  not
  2782. want to do so:
  2783.  
  2784.    - The  metrics  used  by  different  routing  protocols  may not be
  2785.      comparable.  If you  are  connected  to  two  different  external
  2786.      networks,  you  want to specify that one should always be used in
  2787.      preference to the other, or that the nearest one should be  used,
  2788.      rather  than  attempting  to  compare metric information received
  2789.      from the two networks to see which has the better route.
  2790.  
  2791.    - EGP is particularly sensitive, because the  EGP  protocol  cannot
  2792.      handle  loops.    Thus  there  are  strict  rules  governing what
  2793.      information may be communicated to a backbone that uses EGP.   In
  2794.      situations  where  EGP  is being used, management of the backbone
  2795.      network should help you configure your routing.
  2796.  
  2797.    - If you have slow lines in your network (9600 bps or slower),  you
  2798.      may  prefer  not  to send a complete routing table throughout the
  2799.      network.  If you are connected to an external  network,  you  may
  2800.      prefer  to treat it as a default route, rather than to inject all
  2801.      of its routing information into your routing protocol.
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.                                   46
  2824.